Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27531

VS 2010 accessing a file on a remote computer (static ip + secured shared folder)

$
0
0
Hello everyone.

I have a static ip installed on my machine.
I can connect to my machine from anywhere using remote desktop connection.
I had shared a folder with "Share to everyone" option. and i can run any file on this shared folder remotely

Using the Process Class:

Process.Start("\\000.000.000.000\MyFolder\Myfile.txt")

everythig is ok. Now i had removed the "everyone" from the users to make a security on the folder. and then tried the code below to access the file:

PHP Code:

Imports System
Imports System
.Security
Imports System
.Diagnostics
Public Class Form1
    
Private Sub Button1_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        Dim user 
As String "MyUserName"
        
Dim password As String "MyPassword"
        
Dim sPassword As New SecureString()
        
Dim RemoteComputerIP As String "000.000.000.000"
        
Dim filePath As String "\\000.000.000.000\MySharedFolder\myfile.txt"
        
For Each c As Char In password.ToCharArray
            sPassword
.AppendChar(c)
        
Next
        sPassword
.MakeReadOnly()
        
Process.Start(filePathusersPasswordRemoteComputerIP)
    
End Sub
End 
Class 

its gives me the follwing error:
logon failure unknown username or bad password.

Any idea to run a remote file on a secured shared folder?

Thanks for all.

Viewing all articles
Browse latest Browse all 27531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>