Imports System.IO Imports System Imports System.Collections Imports System.Configuration Imports System.Configuration.ConfigurationManager Imports System.Data.OracleClient Imports Microsoft.Office.Interop Imports System.Net.FileWebRequest Imports System.Net Public Sub UploadFile() '(ByVal filepath As String, ByVal filename As String) Dim oSAveAsDir As String = SaveAsDir & strDate & ".xls" Dim FtpUser As String = AppSettings.Get("FtpUserId") Dim FtpPassword As String = AppSettings.Get("FtpPassword") Dim _UploadPath As String = AppSettings.Get("FTPFolderName") '/testarea/cms/support/download/stmt/ Dim clsRequest As System.Net.FtpWebRequest = _ DirectCast(System.Net.WebRequest.Create("ftp://filetransfer/testarea/cms/support/download/stmt/"), System.Net.FtpWebRequest) clsRequest.Credentials = New System.Net.NetworkCredential(FtpUser, FtpPassword) clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile clsRequest.KeepAlive = False ' read in file... Dim bFile() As Byte = System.IO.File.ReadAllBytes(oSAveAsDir) ' upload file... Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream() Dim response As FtpWebResponse = CType(clsRequest.GetResponse(), FtpWebResponse) clsStream.Write(bFile, 0, bFile.Length) clsStream.Close() clsStream.Dispose() End Sub
System.Net.WebRequest.Create("ftp://filetransfer/testarea/cms/support/download/stmt/")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)