| mystuff |
Your IP Address is: 38.107.191.102 |
| home | wsname | wallpaper creator | delphi stuff | vb script stuff | other stuff | contact me |
|
|
Here's a collection of Delphi functions I've found useful. Network Using the DsGetDcName function to return the name of a domain controller in a specified domain Determine if the computer is a member of a Domain or Workgroup - Method 1: Using NetGetJoinInformation Determine if the computer is a member of a Domain or Workgroup - Method 2: Using NetRenameMachineInDomain File System Determine what File System a Drive is Formatted with using GetVolumeInformation Get the Disk Label using GetVolumeInformation using GetVolumeInformation Get the Size of a File
function IsInDomain:Boolean; type Type_NetGetJoinInformation = function(lpServer: LPCWSTR; lpNameBuffer: LPWSTR; BufferType: pointer): longint; stdcall; var b : longint; d : LPWSTR; iResultCode : integer; lngResultCode : LongInt; _NetGetJoinInformation : Type_NetGetJoinInformation; begin Result:=False; try iResultCode:=LoadLibrary(pchar('NetAPI32.dll')); @_NetGetJoinInformation:=GetProcAddress(iResultCode,pchar('NetGetJoinInformation')); lngResultCode:= _NetGetJoinInformation(nil, @d, @b); FreeLibrary(iResultCode); // This contains the domain or workgroup name //sLanGroupName:=(WideCharToString(d)); if b = 3 then Result:=True; FreeBuffer(d); finally end; end; function FreeBuffer(lpBuffer : Pointer):integer; |