|
-
Jan 21st, 2010, 08:43 AM
#1
Thread Starter
New Member
Accessing Network Locations
Hi guys. This is literally my first time in the VB forums.
Picture this: I manage an internet cafe. Now, we also do printing services. Our usual method was to access My Network places, find the PC location of our customer, access the shareable folder that we have our customers save their files in, and save their files.
However, my father asked me to find a way to shorten the process. What my father had in mind was an interface that contained buttons which corresponded to each of the PCs that we have in our cafe. This interface would be used by our 'server' PC. Clicking on each button would cause the explorer to open up the shareable folder in that PC(we'll use the My Documents folder in this scenario), shortening the "Open My Network Places>Find customer PC in network>Find shared folder>Open customer's document" to "Click button related to PC>Open customer's document".
Here's the problem: I have long forgotten how to use Visual Basic(five years of not using it are to blame, unfortunately), and I'm trying to get my bearings again, but as of now, the only thing I'm able to do right now is make the form with the buttons required. I want to ask, though: Is it possible to make a VB form access other network locations?
-
Jan 21st, 2010, 09:47 AM
#2
Hyperactive Member
Re: Accessing Network Locations
Hi walcurayfort,
You can use directoryservices for this. Right click on your project in the solution explorer and click add reference. Then in the tab called .NET scroll down and select System.DirectoryServices and click ok.
You can then use this code:
Code:
Dim de As New DirectoryServices.DirectoryEntry()
Dim workgroup As String = "Workgroup"
de.Path = "WinNT://" & workgroup
Dim computerNames As New List(Of String)
For Each d As DirectoryServices.DirectoryEntry In de.Children()
computerNames.Add(d.Name)
Next
'// Open explorer window (in this case it will open the first one in the list)
Dim sharedFolderName = ""
Process.Start("explorer.exe", "\\" & computerNames(0) & "\" & sharedFolderName)
I hope you'll be able to tweak and change this code to your needs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|