borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Reading modifing text files) New Topic New Poll Post Reply
AndreaVB Forum : VB General : NetShareCheck
Poster Message
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 32

icon NetShareCheck

Hi
I need one VB6 example of using NetShareCheck function
Thanks

09-04-2008 at 07:21 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1016
icon Re: NetShareCheck

Hi
Google came up with this netshare vb6 google result


Private Sub Command1_Click()


   Dim sharetype As Long
   Dim success As Long
   Dim bServer() As Byte
   Dim bShare() As Byte


   bServer() = "\laptopxp" ' -->\server name
   bShare() = "C:windowscursors" ' -->folder to find


   success = NetShareCheck(bServer(0), bShare(0), sharetype)


   Print success & " " & sharetype


End Sub



quote:

...
I have noticed however that the full path to the folder on the remote
machine must be specified, and the drive letter must be upper case. The
correct results seem to be reliably returned if you ucase the entire string,
e.g. bShare() = UCase$("C:windowsCursors").



Hope it helps
Kieron

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)
09-04-2008 at 08:03 AM
View Profile Send Email to User Show All Posts | Quote Reply
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 32
icon Re: NetShareCheck

Hi
I tried your example but it doesn't work:
I have this error:
compilation error, sub or function non defininited

09-04-2008 at 09:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 549
icon Re: NetShareCheck

Maybe you forgot to declare the NetShareCheck API...

add somewhere in your code:


Private Declare Function NetShareCheck Lib "netapi32.dll" _
  (servername As Byte, _
   device As Byte, _
   sharetype As Long) As Long


Use Private if you are calling it from the same module or declaare it Public if you need to call it from everywhere in your project

hope this helps.

____________________________
AndreaVB

09-04-2008 at 03:23 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
emiliana
Level: Scholar

Registered: 27-07-2007
Posts: 32
icon Re: NetShareCheck

Thanks
Now is ok

11-04-2008 at 01:32 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : NetShareCheck
Next Topic (Reading modifing text files) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder