引用Microsoft SQLDMO Object Library,以下函数Copy即可使用:Option ExplicitPrivate mstrServer As StringPublic Function GetAllServerName(ByRef rarrstrServerName() As String, _
                                 Optional ByRef rlngErrNum As Long = 0, _
                                 Optional ByRef rstrErrDescr As String = "") As Boolean
                              
   Dim objServerApp As SQLDMO.Application
   Dim objServers As SQLDMO.NameList
   Dim lngServerCount As Long
   Dim I As Long
   On Error GoTo GetAllServerNameErr
   
   GetAllServerName = False
   Set objServerApp = New SQLDMO.Application
   Set objServers = objServerApp.ListAvailableSQLServers
   
   lngServerCount = objServers.Count
   ReDim rarrstrServerName(lngServerCount - 1)
   
   For I = 1 To lngServerCount
   
      rarrstrServerName(I - 1) = objServers.Item(I)
   
   Next I
   
   GetAllServerName = True
   
   Err.Clear
GetAllServerNameErr:
   Set objServers = Nothing
   Set objServerApp = Nothing
   
   rlngErrNum = Err.Number
   rstrErrDescr = Err.Description
End FunctionPublic Function GetAllDatabase(ByVal vstrServer As String, _
                              ByRef rarrstrDatabase() As String, _
                              Optional ByVal vstrUser As String = "sa", _
                              Optional ByVal vstrPassWord As String = "", _
                              Optional rlngErrNum As Long, _
                              Optional rstrErrDescr As String) As Boolean
                              
   Dim objServer As SQLDMO.SQLServer
   Dim lngDatabaseCount As Long
   Dim I As Long
   On Error GoTo GetAllDatabaseErr
   
   GetAllDatabase = False
   Set objServer = New SQLDMO.SQLServer
   
   objServer.Connect vstrServer, vstrUser, vstrPassWord   lngDatabaseCount = objServer.Databases.Count
   ReDim rarrstrDatabase(lngDatabaseCount - 1)
   
   For I = 1 To lngDatabaseCount
      rarrstrDatabase(I - 1) = objServer.Databases.Item(I, "dbo").Name
   Next I
   
   GetAllDatabase = True
   
   Err.Clear
GetAllDatabaseErr:
   Set objServer = Nothing
   
   rlngErrNum = Err.Number
   rstrErrDescr = Err.DescriptionEnd Function

解决方案 »

  1.   

    这种需要带上SQLSERVER里的一个DLL,太不好了吧
      

  2.   

    谢谢分享。再问一下,如果在没有安装SQL的机器上,要怎样才可以搜索到?
      

  3.   

    回复人: whachun(DIY) ( ) 信誉:100  2005-04-08 08:57:00  得分: 0  
     
     
       这种需要带上SQLSERVER里的一个DLL,太不好了吧
      
     
    ======================================================
    这是搜索SQL Server服务器,不是局域网的计算机,我只想到这种方法,你有更好的方法能否共享出来呢?请教了。我这种方法还有个缺点,当你的网络设置有问题时,是搜索不到的。
      

  4.   

    目标机器如果没开放udp1434你是找不到的..sqldmo的方法在sql server提供的例子中就有
      

  5.   

    这是搜索SQL Server服务器,不是局域网的计算机,我只想到这种方法,你有更好的方法能否共享出来呢?
    ======================
    我记得以前不知是李洪根还是online写过一个但不知放哪了或者去他们的专栏找找吧
      

  6.   

    蓝水晶大虾,你那个自动代码生成器我还没收到。
    再多给你一个[email protected]
    [email protected]谢谢先!
      

  7.   

    [email protected]
    [email protected]查收!
      

  8.   

    [email protected]
    [email protected]
      

  9.   

    可不可以给我也发一个?
    [email protected]
      

  10.   

    [email protected];
    [email protected];
    [email protected];
    [email protected];
    [email protected]
    查收!请问wachel(大脚),你是vbgood的大脚吗?
    如果是,请在vbgood中给那里的网友
    我最想给的还是那里的朋友我会请LionCSQ帮你置顶(LionCSQ是我们经理,他最听我的!:)  )
      

  11.   

    -_- 很简单的,而且也不用带SQLSERVER里的DLL,去看看MSDN里面的NetServerEnum函数说明吧,包括很多种服务器的类型(当然也包括SQL Server),而且还能取到对方运行的操作系统的信息.
      

  12.   

    我用C#写的,可以参考下:
    using System;
    using System.Runtime.InteropServices;
    namespace ServerEnumerator
    {
    /// <summary>
    /// SvrEnumerator 的摘要说明。
    /// </summary>
    public class SvrEnumerator
    {
    public enum SERVER_TYPE_ENUM :uint
    {
    SV_TYPE_WORKSTATION         = 0x00000001,
    SV_TYPE_SERVER              = 0x00000002,
    SV_TYPE_SQLSERVER           = 0x00000004,
    SV_TYPE_DOMAIN_CTRL         = 0x00000008,
    SV_TYPE_DOMAIN_BAKCTRL      = 0x00000010,
    SV_TYPE_TIME_SOURCE         = 0x00000020,
    SV_TYPE_AFP                 = 0x00000040,
    SV_TYPE_NOVELL              = 0x00000080,
    SV_TYPE_DOMAIN_MEMBER       = 0x00000100,
    SV_TYPE_PRINTQ_SERVER       = 0x00000200,
    SV_TYPE_DIALIN_SERVER       = 0x00000400,
    SV_TYPE_XENIX_SERVER        = 0x00000800,
    SV_TYPE_SERVER_UNIX         = SV_TYPE_XENIX_SERVER,
    SV_TYPE_NT                  = 0x00001000,
    SV_TYPE_WFW                 = 0x00002000,
    SV_TYPE_SERVER_MFPN         = 0x00004000,
    SV_TYPE_SERVER_NT           = 0x00008000,
    SV_TYPE_POTENTIAL_BROWSER   = 0x00010000,
    SV_TYPE_BACKUP_BROWSER      = 0x00020000,
    SV_TYPE_MASTER_BROWSER      = 0x00040000,
    SV_TYPE_DOMAIN_MASTER       = 0x00080000,
    SV_TYPE_SERVER_OSF          = 0x00100000,
    SV_TYPE_SERVER_VMS          = 0x00200000,
    SV_TYPE_WINDOWS             = 0x00400000, /* Windows95 and above */
    SV_TYPE_DFS                 = 0x00800000, /* Root of a DFS tree */
    SV_TYPE_CLUSTER_NT          = 0x01000000, /* NT Cluster */
    SV_TYPE_TERMINALSERVER      = 0x02000000, /* Terminal Server(Hydra) */
    SV_TYPE_CLUSTER_VS_NT       = 0x04000000, /* NT Cluster Virtual Server Name */
    SV_TYPE_DCE                 = 0x10000000, /* IBM DSS (Directory and Security Services) or equivalent */
    SV_TYPE_ALTERNATE_XPORT     = 0x20000000, /* return list for alternate transport */
    SV_TYPE_LOCAL_LIST_ONLY     = 0x40000000, /* Return local list only */
    SV_TYPE_DOMAIN_ENUM         = 0x80000000,
    SV_TYPE_ALL                 = 0xFFFFFFFF /* handy for NetServerEnum2 */
    } public struct SERVER_INFO
    {
    public uint sv_platform_id;
    public string sv_platform_name;
    public string sv_name;
    public string sv_IPAddress;
    public uint sv_version_major;
    public uint sv_version_minor;
    public uint sv_type;
    public string sv_comment;
    } unsafe struct SERVER_INFO_101
    {
    public uint sv101_platform_id;
    public char* sv101_name;
    public uint sv101_version_major;
    public uint sv101_version_minor;
    public uint sv101_type;
    public char* sv101_comment;
    }

    unsafe struct HOSTENT
    {
    public char * h_name;
    public char** h_aliases;
    public short h_addrtype;
    public short h_length;
    char** h_addr_list;
    } unsafe struct WSAData 
    {
    public ushort wVersion;
    public ushort wHighVersion;
    public char* szDescription;
    public char* szSystemStatus;
    public ushort iMaxSockets;
    public ushort iMaxUdpDg;
    public char* lpVendorInfo;
    } const uint MAJOR_VERSION_MASK = 0x0F;

    //Win32 API 引入
    [DllImport("Netapi32.dll",EntryPoint="NetServerEnum")]
    private static extern unsafe uint EnumServerAPI(int ReservedParam1,uint level,byte** bufptr,uint prefmaxlen,uint* entriesread,uint* totalentries,uint servertype,string domain,int ReservedParam2);
    [DllImport("Netapi32.dll",EntryPoint="NetServerEnum")]
    private static extern unsafe uint NetApiBufferFree(void** Buffer);
    [DllImport("Ws2_32.dll",EntryPoint="gethostbyname")]
    private static extern unsafe HOSTENT* GetHostByName(string svrName);
    [DllImport("Ws2_32.dll",EntryPoint="WSAGetLastError")]
    private static extern int GetLastSocketError();
    [DllImport("Ws2_32.dll",EntryPoint="WSAStartup")]
    private static extern unsafe int StartupSocket(ushort wVersionRequested,WSAData* lpWSAData);
    [DllImport("Ws2_32.dll",EntryPoint="WSACleanup")]
    private static extern int CleanupSocket(); public SvrEnumerator()
    {
    unsafe
    {
    WSAData wsd;
    int i;
    if(StartupSocket(2,&wsd) != 0)
    {
    i = GetLastSocketError();
    }
    }
    }  ~SvrEnumerator()
    {
    CleanupSocket();
    }
    public unsafe uint EnumServer(SERVER_TYPE_ENUM type,out SERVER_INFO[] svrs)
    {
    SERVER_INFO_101* Buf = null;
    SERVER_INFO_101* TempBuf = null;
    uint uLevel = 101;
    uint uPrefMaxLen = 0xffffffff;
    uint uEntriesRead = 0;
    uint uTotalEntries = 0; if(EnumServerAPI(0,uLevel,(byte**)&Buf,uPrefMaxLen,&uEntriesRead,&uTotalEntries,(uint)type,null,0) == 0)
    {
    //Buf = TempBuf;
    svrs = new SERVER_INFO[uEntriesRead];
    for(int i=0;i<uEntriesRead;i++)
    {
    svrs[i].sv_name = new string(Buf->sv101_name);
    svrs[i].sv_comment = new string(Buf->sv101_comment);
    svrs[i].sv_platform_id = Buf->sv101_platform_id;
    svrs[i].sv_type = Buf->sv101_type;
    svrs[i].sv_version_major = Buf->sv101_version_major & MAJOR_VERSION_MASK;
    svrs[i].sv_version_minor = Buf->sv101_version_minor;
    svrs[i].sv_platform_name = parsePlatformName(svrs[i]);
    svrs[i].sv_IPAddress = GetAddressByName(svrs[i].sv_name);
    Buf++;
    }
    }
    else
    {
    svrs = null;
    }
    //不知道为啥不能free缓冲区
    //if(TempBuf != null)
    // NetApiBufferFree((void**)TempBuf); return uEntriesRead;
    }
    private string parsePlatformName(SERVER_INFO svr)
    {
    if(svr.sv_platform_id == 0)
    return ""; //Microsoft Windows Series
    //Windows 95 or later
    if((svr.sv_type & (uint)SERVER_TYPE_ENUM.SV_TYPE_WINDOWS) == (uint)SERVER_TYPE_ENUM.SV_TYPE_WINDOWS)
    if(svr.sv_version_major < 4)
    return "Microsoft Windows 95";
    else
    return "Microsoft Windows 98";
    //Windows 2000 or later (Server)
    else if((svr.sv_type & (uint)SERVER_TYPE_ENUM.SV_TYPE_SERVER_NT) == (uint)SERVER_TYPE_ENUM.SV_TYPE_SERVER_NT)
    switch(svr.sv_version_major)
    {
    case 4:
    return "Microsoft Windows NT Server";
    case 5:
    switch(svr.sv_version_minor)
    {
    case 0:
    return "Microsoft Windows 2000 Server";
    case 1:
    return "Microsoft Windows XP";
    case 2:
    return "Microsoft Windows 2003 Server";
    }
    break;
    }
    //Windows 2000 or later
    else if((svr.sv_type & (uint)SERVER_TYPE_ENUM.SV_TYPE_NT) == (uint)SERVER_TYPE_ENUM.SV_TYPE_NT)
    switch(svr.sv_version_major)
    {
    case 4:
    return "Microsoft Windows NT";
    case 5:
    switch(svr.sv_version_minor)
    {
    case 0:
    return "Microsoft Windows 2000";
    case 1:
    return "Microsoft Windows XP";
    case 2:
    return "Microsoft Windows 2003 Server";
    }
    break;
    }
    return "";

    } private unsafe string GetAddressByName(string svrName)
    {
    if(svrName == "" || svrName == null)
    return null;

    HOSTENT* phostent;
    phostent=GetHostByName(svrName);
    if(phostent == null)
    return "";

    return "";
    }
    }
    }
      

  13.   

    果然好!其实我还用WNetEnumResource写了一个,但限于篇副,不能在此贴出,只贴出关键的类吧,这个类可以得到网络中的任何资源,包括种类服务器、打印机、共享文件夹......等等。
    Option ExplicitPublic Enum NetResourceTypes
       Generic = 0
       Domain = 1
       Server = 2
       share = 3
       File = 4
       Group = 5
       Network = 6
       Root = 7
       ShareAdmin = 8
       Directory = 9
       Tree = 10
       NDSContainer = 11
       Printer = &HFF
    End EnumPrivate mudtNetRes2 As typNetRes2
    Private mblnGotChildren As Boolean
    Private mobjNetResources As clsNetResources
    Private mblnAmRoot As Boolean
    Private mblnAmPrinter As BooleanPrivate Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
    Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
    Private Declare Function lstrcpyA Lib "kernel32" Alias "lstrcpy" (ByVal NewString As String, ByVal OldString As Long) As Long
    Private Declare Function WNetOpenEnum Lib "mpr.dll" Alias "WNetOpenEnumA" (ByVal dwScope As Long, ByVal dwType As Long, ByVal dwUsage As Long, lpNetResource As Any, lphEnum As Long) As Long
    Private Declare Function WNetEnumResource Lib "mpr.dll" Alias "WNetEnumResourceA" (ByVal hEnum As Long, lpcCount As Long, ByVal lpBuffer As Long, ByRef lpBufferSize As Long) As Long
    Private Declare Function WNetCloseEnum Lib "mpr.dll" (ByVal hEnum As Long) As LongPrivate Type typNetResource
       dwScope As Long
       dwType As Long
       dwDisplayType As Long
       dwUsage As Long
       lpLocalName As Long
       lpRemoteName As Long
       lpComment As Long
       lpProvider As Long
    End Type
       
    Private Type typNetRes2
       dwScope As Long
       dwType As Long
       dwDisplayType As Long
       dwUsage As Long
       lpLocalName As String
       lpRemoteName As String
       lpComment As String
       lpProvider As String
    End TypePrivate Const RESOURCE_CONNECTED = &H1
    Private Const RESOURCE_GLOBALNET = &H2
    Private Const RESOURCE_REMEMBERED = &H3
    Private Const RESOURCE_CONTEXT = &H5Private Const RESOURCETYPE_ANY = &H0
    Private Const RESOURCETYPE_DISK = &H1
    Private Const RESOURCETYPE_PRINT = &H2
    Private Const RESOURCETYPE_UNKNOWN = &HFFFFPrivate Const RESOURCEUSAGE_CONNECTABLE = &H1
    Private Const RESOURCEUSAGE_CONTAINER = &H2
    Private Const RESOURCEUSAGE_RESERVED = &H80000000Private Const GMEM_DDESHARE = &H2000
    Private Const GMEM_DISCARDABLE = &H100
    Private Const GMEM_DISCARDED = &H4000
    Private Const GMEM_FIXED = &H0
    Private Const GMEM_INVALID_HANDLE = &H8000
    Private Const GMEM_LOCKCOUNT = &HFF
    Private Const GMEM_MODIFY = &H80
    Private Const GMEM_MOVEABLE = &H2
    Private Const GMEM_NOCOMPACT = &H10
    Private Const GMEM_NODISCARD = &H20
    Private Const GMEM_NOT_BANKED = &H1000
    Private Const GMEM_NOTIFY = &H4000
    Private Const GMEM_SHARE = &H2000
    Private Const GMEM_VALID_FLAGS = &H7F72
    Private Const GMEM_ZEROINIT = &H40
    Private Const GPTR = (GMEM_FIXED Or GMEM_ZEROINIT)Private Const ERROR_MORE_DATA = 234Private Const RESOURCEDISPLAYTYPE_GENERIC = 0
    Private Const RESOURCEDISPLAYTYPE_DOMAIN = 1
    Private Const RESOURCEDISPLAYTYPE_SERVER = 2
    Private Const RESOURCEDISPLAYTYPE_SHARE = 3
    Private Const RESOURCEDISPLAYTYPE_FILE = 4
    Private Const RESOURCEDISPLAYTYPE_GROUP = 5
    Private Const RESOURCEDISPLAYTYPE_NETWORK = 6
    Private Const RESOURCEDISPLAYTYPE_ROOT = 7
    Private Const RESOURCEDISPLAYTYPE_SHAREADMIN = 8
    Private Const RESOURCEDISPLAYTYPE_DIRECTORY = 9
    Private Const RESOURCEDISPLAYTYPE_TREE = &HA
    Private Const RESOURCEDISPLAYTYPE_NDSCONTAINER = &HBPrivate Sub GetPrinters()   Dim lngEnum As Long, lngLpBuff As Long
       Dim lngCbBuff As Long, lngCount As Long
       Dim I As Long, J As Long, lngRet As Long
       Dim lngEnumHTemp As Long
       Dim udtNetResource As typNetResource
       Dim udtNetRes2 As typNetRes2
       Dim objNetResource As clsNetResource
       
       If mblnAmRoot Then
          udtNetResource.dwUsage = RESOURCEUSAGE_CONNECTABLE
          udtNetResource.lpRemoteName = 0
       End If
       
       lngRet = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_PRINT, RESOURCEUSAGE_CONNECTABLE, mudtNetRes2, lngEnum)
       
       If lngRet <> 0 Then
          Exit Sub
       End If
       
       lngEnumHTemp = lngEnum
       lngCbBuff = 1024&
       lngLpBuff = GlobalAlloc(GPTR, lngCbBuff)
       Do
          lngEnumHTemp = lngEnum
          lngCount = &HFFFFFFFF
          lngRet = WNetEnumResource(lngEnum, lngCount, lngLpBuff, lngCbBuff)
          If lngRet = ERROR_MORE_DATA Then
             
             GlobalFree lngLpBuff
             lngLpBuff = GlobalAlloc(GPTR, lngCbBuff)
          Else
             If lngRet = 0 Then
                J = lngLpBuff
                
                For I = 1 To lngCount
                   CopyMemory udtNetResource, ByVal J, LenB(udtNetResource)
                   J = J + LenB(udtNetResource)
                   If udtNetResource.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE Then
                      udtNetRes2.dwDisplayType = udtNetResource.dwDisplayType
                      udtNetRes2.dwScope = udtNetResource.dwScope
                      udtNetRes2.dwType = udtNetResource.dwType
                      udtNetRes2.dwUsage = udtNetResource.dwUsage
                      udtNetRes2.lpComment = lStrCpy(udtNetResource.lpComment)
                      udtNetRes2.lpLocalName = lStrCpy(udtNetResource.lpLocalName)
                      udtNetRes2.lpProvider = lStrCpy(udtNetResource.lpProvider)
                      udtNetRes2.lpRemoteName = lStrCpy(udtNetResource.lpRemoteName)
                      Set objNetResource = New clsNetResource
                      objNetResource.NRStruct = udtNetRes2
                      objNetResource.IsPrinter = True
                      mobjNetResources.Add objNetResource
                   End If
                Next
             End If
          End If
       Loop Until lngCount = 0
       
       WNetCloseEnum lngEnum
       GlobalFree lngLpBuffEnd Sub后续......
      

  14.   

    上面的代码有些case少写了break哈.自己看着办
      

  15.   

    Friend Property Let IsPrinter(pVal As Boolean)
       mblnAmPrinter = pVal
    End PropertyPrivate Function lStrCpy(lStrPointer As Long) As String
       Dim strTemp As String
       strTemp = String(255, Chr$(0))
       lstrcpyA strTemp, lStrPointer
       lStrCpy = Left(strTemp, InStr(strTemp, Chr$(0)) - 1)
    End FunctionPublic Property Get Children() As clsNetResources
       If Not mblnGotChildren Then
          GetChildren
       End If
       Set Children = mobjNetResources
    End PropertyPublic Property Get Comment() As String
       Comment = mudtNetRes2.lpComment
    End PropertyPrivate Sub GetChildren()   Dim lngEnum As Long, lngLpBuff As Long
       Dim lngCbBuff As Long, lngCount As Long
       Dim I As Long, res As Long, J As Long
       Dim lngEnumHTemp As Long
       Dim udtNetResource As typNetResource
       Dim udtNetRes2 As typNetRes2
       Dim objNetResource As clsNetResource
       
       Set mobjNetResources = New clsNetResources
       
       If mblnAmRoot Then
          udtNetResource.dwUsage = RESOURCEUSAGE_CONNECTABLE
          udtNetResource.lpRemoteName = 0
       End If
       
       res = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, 0, mudtNetRes2, lngEnum)
       
       If res <> 0 Then
          Exit Sub
       End If
       
       lngEnumHTemp = lngEnum
       lngCbBuff = 1024&
       lngLpBuff = GlobalAlloc(GPTR, lngCbBuff)
       Do
          lngEnumHTemp = lngEnum
          lngCount = &HFFFFFFFF
          res = WNetEnumResource(lngEnum, lngCount, lngLpBuff, lngCbBuff)
          If res = ERROR_MORE_DATA Then
             GlobalFree lngLpBuff
             lngLpBuff = GlobalAlloc(GPTR, lngCbBuff)
          Else
             If res = 0 Then
                I = lngLpBuff
                
                For J = 1 To lngCount
                   CopyMemory udtNetResource, ByVal I, LenB(udtNetResource)
                   I = I + LenB(udtNetResource)
                   udtNetRes2.dwDisplayType = udtNetResource.dwDisplayType
                   udtNetRes2.dwScope = udtNetResource.dwScope
                   udtNetRes2.dwType = udtNetResource.dwType
                   udtNetRes2.dwUsage = udtNetResource.dwUsage
                   udtNetRes2.lpComment = lStrCpy(udtNetResource.lpComment)
                   udtNetRes2.lpLocalName = lStrCpy(udtNetResource.lpLocalName)
                   udtNetRes2.lpProvider = lStrCpy(udtNetResource.lpProvider)
                   udtNetRes2.lpRemoteName = lStrCpy(udtNetResource.lpRemoteName)
                   Set objNetResource = New clsNetResource
                   objNetResource.NRStruct = udtNetRes2
                   mobjNetResources.Add objNetResource
                Next
             End If
          End If
       Loop Until lngCount = 0
       
       WNetCloseEnum lngEnum
       GlobalFree lngLpBuff
       GetPrinters
       
       mblnGotChildren = TrueEnd SubPublic Property Get LocalName() As String
       LocalName = mudtNetRes2.lpLocalName
    End PropertyFriend Property Let NRStruct(RHS As typNetRes2)
       mudtNetRes2 = RHS
       mblnAmRoot = False
    End PropertyPublic Property Get Provider() As String
       Provider = mudtNetRes2.lpProvider
    End PropertyPublic Property Get RemoteName() As String
       RemoteName = mudtNetRes2.lpRemoteName
    End PropertyPublic Property Get ResourceType() As NetResourceTypes
       If Not mblnAmPrinter Then
          ResourceType = mudtNetRes2.dwDisplayType
       Else
          ResourceType = Printer
       End If
    End PropertyPublic Property Get ResourceTypeName() As String
       If mblnAmPrinter Then
          ResourceTypeName = "Printer"
          Exit Property
       End If
       Select Case mudtNetRes2.dwDisplayType
          Case RESOURCEDISPLAYTYPE_GENERIC
             ResourceTypeName = "Generic"
          Case RESOURCEDISPLAYTYPE_DOMAIN
             ResourceTypeName = "Domain"
          Case RESOURCEDISPLAYTYPE_SERVER
             ResourceTypeName = "Server"
          Case RESOURCEDISPLAYTYPE_SHARE
             ResourceTypeName = "Share"
          Case RESOURCEDISPLAYTYPE_FILE
             ResourceTypeName = "File"
          Case RESOURCEDISPLAYTYPE_GROUP
             ResourceTypeName = "Group"
          Case RESOURCEDISPLAYTYPE_NETWORK
             ResourceTypeName = "Network"
          Case RESOURCEDISPLAYTYPE_ROOT
             ResourceTypeName = "Root"
          Case RESOURCEDISPLAYTYPE_SHAREADMIN
             ResourceTypeName = "AdminShare"
          Case RESOURCEDISPLAYTYPE_DIRECTORY
             ResourceTypeName = "Directory"
          Case RESOURCEDISPLAYTYPE_TREE
             ResourceTypeName = "Tree"
          Case RESOURCEDISPLAYTYPE_NDSCONTAINER
             ResourceTypeName = "NDSContainer"
       End Select
    End PropertyPublic Property Get ShortName() As String
       Dim I As Integer
       I = InStrRev(mudtNetRes2.lpRemoteName, "\")
       ShortName = Right(mudtNetRes2.lpRemoteName, Len(mudtNetRes2.lpRemoteName) - I)
    End PropertyPrivate Sub Class_Initialize()
       mblnAmRoot = True
    End SubPrivate Sub Class_Terminate()
       Set mobjNetResources = Nothing
    End Sub
      

  16.   

    XunBaian (蓝水晶) 請給我發一份,非常感謝[email protected]
      

  17.   

    复人: xwtyhr() ( ) 信誉:100  2005-04-13 15:37:00  得分: 0  
     
     
       XunBaian (蓝水晶) 請給我發一份,非常感謝[email protected]
      
     
    ==========================================
    是“数据访问服务层组件” + “代码生成器”吗?已发!"594xwt" <[email protected]>
    "chunposoft" <[email protected]>
    "bill" <[email protected]>
    "chunposoft" <[email protected]>
    "applecut" <[email protected]>
    "super_px" <[email protected]>
    "zzgthc" <[email protected]>
    "chd2001_ren" <[email protected]>
    "kikikaki" <[email protected]>
    以上邮件查收!
      

  18.   

    有关代码生成器及其支持的组件使用疑问或有好的建议,欢迎到此讨论:
    http://www.vbgood.com
    http://202.101.71.156/forum/forum_posts.asp?TID=21419&PN=1&TPN=1
      

  19.   

    [email protected]
    请换邮箱,该邮箱解析不了,其它所有此时间前的都已发,请注意查收!这些东东是在LionCSQ的监督下完成,其核心思想由他发起,在某些方面他的解释比我的更权威,欢迎进入上贴论坛讨论:
      

  20.   

    [email protected]
    thanks