如题目

解决方案 »

  1.   

    试试这个:edPath.Text:='//pc1/we'; //到网上邻居中看看路径 while not DirectoryExists(edPath.Text) do
      begin
        DisplayMessage('机器没有连接上!完成确认!');  
      end;
      

  2.   

    有没有try 呀?我试过,应该好用的。
      

  3.   

    这种方法不行,我的网络比较复杂,最好走TCP/IP
      

  4.   

    我帮你解决吧.
    if ipaddrtoname('19.23.33.33')='' then 
    showmessage('not connection') else showmessage('is connection');function IPAddrToName(IPAddr : String): String;
      var
        SockAddrIn: TSockAddrIn;
        HostEnt: PHostEnt;
        WSAData: TWSAData;
      begin
        WSAStartup($101, WSAData);
        SockAddrIn.sin_addr.s_addr:= inet_addr(PChar(IPAddr));
        HostEnt:= gethostbyaddr(@SockAddrIn.sin_addr.S_addr, 4, AF_INET);
        if HostEnt<>nil then
        begin
          result:=StrPas(Hostent^.h_name)
        end
        else
        begin
          result:='';
        end;
      end;