Private Sub onWorkflowActivated1_Invoked(ByVal sender As System.Object, ByVal e As System.Workflow.Activities.ExternalDataEventArgs)
Try
Dim request As FtpWebRequest = CType(WebRequest.Create(ConfigurationManager.AppSettings("FTPHost") + Me.workflowProperties.Item.File.Name), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("FTPUser"), ConfigurationManager.AppSettings("FTPPassword"))
Dim webCl As WebClient = New WebClient()
webCl.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("SPUser"), ConfigurationManager.AppSettings("SPPassword"))
Dim buffer() As Byte = webCl.DownloadData(ConfigurationManager.AppSettings("CurrentSite") + Me.workflowProperties.Item.File.Url)
request.GetRequestStream().Write(buffer, 0, buffer.Length)
request = Nothing
Catch ex As Exception
End Try
End Sub
No comments:
Post a Comment