hidden hit counter
Help!

how do you find windows shared folders?


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Networking RSS
Next:  TCPIP how  
Author Message
bobrien18
External


Since: Oct 19, 2005
Posts: 1



PostPosted: Wed Oct 19, 2005 9:19 am    Post subject: how do you find windows shared folders?
Archived from groups: comp>lang>basic>visual>misc, others (more info?)

I am writing a piece of software to back up a shared folder on one
computer to another computer.
I need a list of the shared folders available on the network I am
connected to by ethernet.
The computers are both windows machines... One is a Windows 98 computer
and the other (the one that is doing the query) is windows XP.

I am writing in VB6 and Visual C++ (I do OCXs in C++)

I am comfortable writing socket level code to broadcast a discovery
packet if that is necessary,
and parse the response results, but if there is already an API for this
then of course that would be better.

Thanks.
B.
Back to top
Norm Cook
External


Since: Oct 07, 2004
Posts: 16



PostPosted: Thu Oct 20, 2005 7:58 am    Post subject: Re: how do you find windows shared folders? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Below is a function to tell you if a folder is shared. Now you need code
to enumerate network folders. Perhaps you can use this:
http://vbnet.mvps.org/code/browse/browsenetwork.htm

Const SHGFI_ATTRIBUTES = &H800
Const SFGAO_SHARE = &H20000
Private Type SHFILEINFO
hIcon As Long
iIcon As Long
dwAttributes As Long
szDisplayName As String * 260
szTypeName As String * 80
End Type
Private Declare Function SHGetFileInfo Lib "shell32.dll" Alias
"SHGetFileInfoA" _
(ByVal pszPath As String, ByVal dwFileAttributes As Long, _
psfi As SHFILEINFO, ByVal cbFileInfo As Long, ByVal uFlags As Long) As
Long
Private Function IsFolderShared(ByVal folderName As String) As Boolean
Dim sfi As SHFILEINFO
SHGetFileInfo folderName, 0, sfi, Len(sfi), SHGFI_ATTRIBUTES
IsFolderShared = (sfi.dwAttributes And SFGAO_SHARE)
End Function

<bobrien18.RemoveThis@yahoo.com> wrote in message
news:1129738752.323788.130110@g14g2000cwa.googlegroups.com...
> I am writing a piece of software to back up a shared folder on one
> computer to another computer.
> I need a list of the shared folders available on the network I am
> connected to by ethernet.
> The computers are both windows machines... One is a Windows 98 computer
> and the other (the one that is doing the query) is windows XP.
>
> I am writing in VB6 and Visual C++ (I do OCXs in C++)
>
> I am comfortable writing socket level code to broadcast a discovery
> packet if that is necessary,
> and parse the response results, but if there is already an API for this
> then of course that would be better.
>
> Thanks.
> B.
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Networking All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum