有没有办法确定用于 Windows 上已安装网络驱动器的协议名称(SMB/CIFS、NFS)和版本?(在 C# 中)
编辑
使用 Rusted 的答案中的信息,我从网络上的 Windows 7 计算机获得了以下信息。
NETRESOURCE res = WinApiWNETwrapper.GetResourceInfo("\\Test-PC");
res.dwDisplayType = SERVER
res.dwScope = 0
res.dwType = ANY
res.dwUsage = CONTAINER
res.lpComment = ""
res.lpLocalName = null
res.lpProvider = "Microsoft Windows Network"
res.lpLocalName = "\\Test-PC"
NETINFOSTRUCT netinfo = WinApiWNETwrapper.GetNetworkInfo("\\Test-PC");
netinfo.cbStructureSize = 32
netinfo.dwCharacteristics = 0
netinfo.dwDrives = -1
netinfo.dwHandle = 1880621056
netinfo.dwPrinters = -1
netinfo.dwProviderVersion = 1024
netinfo.dwStatus = Running
netinfo.wNetType = LANMAN
SERVER_TRANSPORT_INFO_1[] transports = WinApiNETwrapper.ServerTransportEnum_1("\\Test-PC");
transports[0].svti1_domain = "WORKGROUP"
transports[0].svti1_networkaddress = "TEST-PC"
transports[0].svti1_numberofvcs = 0
transports[0].svti1_transportaddress = 73107336
transports[0].svti1_transportaddresslength = ...
transports[0].TransportAddress = "TEST-PC"
transports[0].svti1_transportname = "\\Device\\NetbiosSmb"
transports[1].svti1_transportname = "\\Device\\NetBT_Tcpip_{F4C75115-...}"
transports[2].svti1_transportname = "\\Device\\NetBT_Tcpip_{70BD9048-...}"
重要的部分似乎是:
transports[0].svti1_transportname = "\\Device\\NetbiosSmb"
但是我在任何地方都找不到 SMB 协议的版本号。有任何想法吗?