|
|
|
Click here to copy the following block | Private Declare Function NetGetDCName Lib "netapi32.dll" (strServerName As Any, _ strDomainName As Any, pBuffer As Long) As Long Private Declare Function NetApiBufferFree Lib "netapi32.dll" (buffer As Any) As _ Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _ Any, source As Any, ByVal bytes As Long)
Function GetPDCName() As String Dim lpBuffer As Long Dim buffer As String If NetGetDCName(vbNullString, vbNullString, lpBuffer) = 0 Then buffer = Space$(128) CopyMemory ByVal StrPtr(buffer), ByVal lpBuffer, LenB(buffer) GetPDCName = Left$(buffer, InStr(buffer & vbNullChar, vbNullChar) - 1) NetApiBufferFree lpBuffer End If
End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|