Remote Login and Copy File
'''''''''''''''Login
To Remote system Share Folder '''''''''''''''''''''''
Open_Remote_Connection(ServerIP, ServerUser,
ServerPass)
'''''''''''''''Copy
File Share Folder '''''''''''''''''''''''
''' To Copy a file please create a shared folder in the destination system with full access.
System.IO.File.Copy(strFullFile, ServerPath
+ strDocentry + "_" +
strCardCode.Trim() + ".xls")
Private Sub Open_Remote_Connection(ByVal
strComputer As String,
ByVal strUserName As
String, ByVal
strPassword As String)
Try
Dim
ProcessStartInfo As New
System.Diagnostics.ProcessStartInfo
ProcessStartInfo.FileName = "net"
ProcessStartInfo.Arguments = "use \\" & strComputer & "\c$ /USER:" & strUserName & " " & strPassword
ProcessStartInfo.WindowStyle =
ProcessWindowStyle.Hidden
System.Diagnostics.Process.Start(ProcessStartInfo)
System.Threading.Thread.Sleep(2000)
Catch
ex As Exception
End Try
End Sub
No comments:
Post a Comment