I'm using VB 6 on Windows XP Pro -
I need to know how to grab the "Shared Folders Sessions" collection. (This can be viewed on XP by right clicking my computer, click manage, then shared folders, sessions)
I've been told I can use WMI in VB6 to do this, but I don't know where to find the code....please provide code to grab this collection info. I need VB to do it, not a VBS script file.
Thanks!!!
Discussion on:
Shared Session data with VB6 + WMI?
Tags: programming
View:
Show:
Win32_ServerConnection will show you that information. It's properties include .ComputerName, .ShareName, .UserName
'--------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSessions = objWMIService.InstancesOf("Win32_ServerConnection")
For Each Connection In colSessions
'Put your code here
Next
'--------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSessions = objWMIService.InstancesOf("Win32_ServerConnection")
For Each Connection In colSessions
'Put your code here
Next
- Keyboard Shortcuts:
- Prev
- Next
- Toggle

































