CnPack Forum


 
Subject: 以下代码格式化出错.
fxerp@qq.com
新警察
Rank: 1



UID 233612
Digest Posts 0
Credits 24
Posts 6
点点分 24
Reading Access 10
Registered 2015-8-25
Status Offline
Post at 2015-9-17 11:23  Profile | Blog | P.M. 
以下代码格式化出错.

function GetLocalIP: string;
var
  WSData: TWSAData;
  Buffer: array[0..63] of ansiChar;
  HostEnt: PHostEnt;
  PPInAddr: ^PInAddr;
  IPString: string;
begin
  IPString := '';
  try
    WSAStartUp($101, WSData);
    GetHostName(Buffer, SizeOf(Buffer));
    HostEnt := GetHostByName(Buffer);
    if Assigned(HostEnt) then
    begin
      PPInAddr := @(PInAddr(HostEnt.H_Addr_List^));
      while Assigned(PPInAddr^) do
      begin
        IPString := string(StrPas(INet_NToA(PPInAddr^^)));
        Inc(PPInAddr);
      end;
    end;
    Result := IPString;
  finally
    try
      WSACleanUp;
    except
    end;
  end;
end;
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2015-9-17 16:24  Profile | Blog | P.M. 
感谢报告,这是上一两个版本增加对^J^M这样的字符串支持时带来的副作用。下一版本将修正。
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2015-9-18 05:17  Profile | Blog | P.M. 
771版本已经修正,http://www.cnpack.org/downbuilds.php
Top
 




All times are GMT++8, the time now is 2024-11-22 18:14

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.009426 second(s), 9 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP