如何驗證 nt domain, 即登入

有關Delphi 的語法, 程式, 等
回覆文章
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

如何驗證 nt domain, 即登入

文章 tim »

如何驗證 nt domain, 即登入

代碼: 選擇全部

     
    { 檢查NT登入帳號密碼 } 
    function checkNTPass(iUserID, iPassword, iRemoteName: String): Boolean; 
    var 
      lpNetResource:  _NETRESOURCE; 
    begin 
      lpNetResource.dwType := RESOURCETYPE_ANY; 
      lpNetResource.lpLocalName := Nil; 
      lpNetResource.lpRemoteName := PChar(iRemoteName); 
      lpNetResource.lpProvider := Nil; 
      case WNetAddConnection2(lpNetResource, PChar(iPassword), PChar(iUserID), 0) of 
        NO_ERROR: begin 
          Result := True; 
          if WNetCancelConnection2(PChar(iRemoteName), 0, true) <> NO_ERROR then 
            //showMessage('無法離線') 
          else 
            //showMessage('已離線'); 
        end else 
          Result := False; 
      end; 
    end; 
多多留言, 整理文章, 把經驗累積下來.....
回覆文章