Re: network path and use of netsharecheck api....
From: N|O (foolish3_at_hotmail.com)
Date: 08/05/04
- Next message: tlviewer: "Re: rfc: persist all CSP provider,algorithm, and keyspace data to DB"
- Previous message: mr unreliable: "one final (very nasty) thought"
- In reply to: Randy Birch: "Re: network path and use of netsharecheck api...."
- Next in thread: Randy Birch: "Re: network path and use of netsharecheck api...."
- Reply: Randy Birch: "Re: network path and use of netsharecheck api...."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 05 Aug 2004 00:22:25 GMT
OK, thanks, now it work, but another problem is come out.....ìf server needs
an user n pass to allowe to the client to visualize the path? In this type
of situation this program give me this error: 5....couse i was not
autenticate before....if i autenticate myself, all work...how can i bypass
this problem?
"Randy Birch" <rgb_removethis@mvps.org> ha scritto nel messaggio
news:elsLtaleEHA.596@TK2MSFTNGP11.phx.gbl...
> This appears to work:
>
> Private Declare Function NetShareCheck Lib "netapi32.dll" _
> (servername As Byte, _
> device As Byte, _
> sharetype As Long) As Long
>
>
> 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:\windows\cursors" ' -->folder to find
>
> success = NetShareCheck(bServer(0), bShare(0), sharetype)
>
> Print success & " " & sharetype
>
> End Sub
>
>
> 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:\windows\Cursors").
>
> --
>
> Randy Birch
> MVP Visual Basic
> http://vbnet.mvps.org/
> Please respond only to the newsgroups so all can benefit.
>
>
> "N|O" <foolish3@hotmail.com> wrote in message
> news:vI6Qc.96043$5D1.4929867@news4.tin.it...
> : hii, i have to know if a folder, situated in \\server\images (for
example)
> : exists.
> :
> : This is the vb code i use:
> :
> : Private Declare Function NetShareCheck Lib "netapi32.dll" _
> : (ByVal ServerName As String, _
> : ByVal Device As String, _
> : ByRef ShareType As Long) As Long
> :
> :
> : Private Sub Command1_Click()
> : Dim SName As String
> : Dim SHName As String
> : Dim DevType As Long
> : Dim Ans As Long
> :
> : SName = Text1.Text -->\\server name
> : SHName = Text2.Text -->folder to find
> : DevType = -1
> :
> : Ans = NetShareCheck(StrConv(SName, vbUnicode),
StrConv(UCase(SHName),
> : vbUnicode), DevType)
> : MsgBox Ans, , DevType
> : End Sub
> :
> : devtype return is 0, i think maybe the server exist, but Ans return
> : 2311...this means: NetShareCheck fails with error 2311
> : (NERR_DeviceNotShared) when remoted to OS/2.
> :
> : How can i resolve this?
> : Thakns a lot
> :
> :
>
- Next message: tlviewer: "Re: rfc: persist all CSP provider,algorithm, and keyspace data to DB"
- Previous message: mr unreliable: "one final (very nasty) thought"
- In reply to: Randy Birch: "Re: network path and use of netsharecheck api...."
- Next in thread: Randy Birch: "Re: network path and use of netsharecheck api...."
- Reply: Randy Birch: "Re: network path and use of netsharecheck api...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|