Click here to Skip to main content
16,006,877 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: TextBox Issue Pin
Syed Ali Raza8-Feb-08 3:01
Syed Ali Raza8-Feb-08 3:01 
GeneralExport Data In excel and do wrap text[modified] Pin
nishkarsh_k7-Feb-08 23:10
nishkarsh_k7-Feb-08 23:10 
GeneralObject and Threading Pin
splater7-Feb-08 23:07
splater7-Feb-08 23:07 
GeneralRe: Object and Threading Pin
super_kitten3-May-08 19:32
super_kitten3-May-08 19:32 
GeneralI wrote code to convert html to pdf by using iTextsharper.dll, but it is .pdf file is not opening.Any one please help me. Pin
sudhakar797-Feb-08 22:07
sudhakar797-Feb-08 22:07 
GeneralRe: I wrote code to convert html to pdf by using iTextsharper.dll, but it is .pdf file is not opening.Any one please help me. Pin
LloydA1119-Feb-08 2:19
LloydA1119-Feb-08 2:19 
QuestionAlways asking parameters in crystal report Pin
robinsimon_m7-Feb-08 19:48
robinsimon_m7-Feb-08 19:48 
GeneralFTP Problem Pin
Michael1017-Feb-08 17:53
Michael1017-Feb-08 17:53 
Hi Everyone,

I've got an FTP problem. I've been trying to make my own FTP program but it doesn't quite work and I'm not sure why.

Dim FileName As String = xmlFileName
Dim ftpServerIP = "202.62.33.220"

Dim fileInf As New FileInfo(FileName)
Dim uri As String = "ftp://" + ftpServerIP + "/" + fileInf.Name
Dim reqFTP As FtpWebRequest

' Create FtpWebRequest object from the Uri provided
reqFTP = DirectCast(FtpWebRequest.Create(New Uri("ftp://" + ftpServerIP + "/" + fileInf.Name)), FtpWebRequest)
MsgBox("ftp://" + ftpServerIP + "/" + fileInf.Name)
' Provide the WebPermission Credintials
reqFTP.Credentials = New NetworkCredential("MHR\administrator", "sbanks@#@")
' By default KeepAlive is true, where the control connection is not closed
' after a command is executed.
reqFTP.KeepAlive = False
' Specify the command to be executed.
reqFTP.Method = WebRequestMethods.Ftp.UploadFile
' Specify the data transfer type.
reqFTP.UseBinary = True
' Notify the server about the size of the uploaded file
reqFTP.ContentLength = fileInf.Length
' The buffer size is set to 2kb
Dim buffLength As Integer = 2048
Dim buff As Byte() = New Byte(buffLength - 1) {}
Dim contentLen As Integer
' Opens a file stream (System.IO.FileStream) to read the file to be uploaded
Dim fs As FileStream = fileInf.OpenRead()
'Try
' Stream to which the file to be upload is written
Dim strm As Stream = reqFTP.GetRequestStream()
' Read from the file stream 2kb at a time
contentLen = fs.Read(buff, 0, buffLength)
' Till Stream content ends
While contentLen <> 0
' Write Content from the file stream to the FTP Upload Stream
******strm.Write(buff, 0, contentLen)*********
contentLen = fs.Read(buff, 0, buffLength)
End While
' Close the file stream and the Request Stream
strm.Close()
fs.Close()
'Catch ex As Exception
'MsgBox(ex.Message, "Upload Error")
'End Try

Where all the stars are is where the error occurs. The error message is this: (421) Service not available, closing control connection.

Does anyone have any ideas? I was thinking it was something to do with no port declaration but I'm try to find out how to declare one to see if that fixes the problem.

All your help is muchly appreciated in advance.

Cheers.

Michael Smile | :)
GeneralRe: FTP Problem Pin
_Fandango_8-Feb-08 1:23
_Fandango_8-Feb-08 1:23 
Questionvariable issue Pin
Tauseef A7-Feb-08 16:31
Tauseef A7-Feb-08 16:31 
AnswerRe: variable issue Pin
Guffa7-Feb-08 19:50
Guffa7-Feb-08 19:50 
QuestionRe: variable issue Pin
Tauseef A7-Feb-08 20:08
Tauseef A7-Feb-08 20:08 
GeneralRe: variable issue Pin
Guffa7-Feb-08 23:46
Guffa7-Feb-08 23:46 
QuestionUndo / Redo and Collections Pin
nosiller7-Feb-08 16:22
nosiller7-Feb-08 16:22 
GeneralRe: Undo / Redo and Collections Pin
Richard Blythe7-Feb-08 17:42
Richard Blythe7-Feb-08 17:42 
GeneralRe: Undo / Redo and Collections Pin
Dave Kreskowiak8-Feb-08 8:02
mveDave Kreskowiak8-Feb-08 8:02 
QuestionMultiple Projects in a solution using visual sourcesafe [modified] Pin
Jack Brando7-Feb-08 15:36
Jack Brando7-Feb-08 15:36 
QuestionMultiple Projects inside Visual SourceSafe Pin
Jack Brando7-Feb-08 15:12
Jack Brando7-Feb-08 15:12 
GeneralReading points in a Zed Graph Pin
loganj19997-Feb-08 12:19
loganj19997-Feb-08 12:19 
GeneralRe: Reading points in a Zed Graph Pin
Dave Kreskowiak8-Feb-08 7:51
mveDave Kreskowiak8-Feb-08 7:51 
GeneralRemoving Controls in Access forms using VB Pin
reegan417-Feb-08 11:09
reegan417-Feb-08 11:09 
GeneralWrong forum Pin
pmarfleet7-Feb-08 11:53
pmarfleet7-Feb-08 11:53 
GeneralRe: Wrong forum Pin
Christian Graus7-Feb-08 12:08
protectorChristian Graus7-Feb-08 12:08 
GeneralRe: Removing Controls in Access forms using VB Pin
ChandraRam8-Feb-08 0:48
ChandraRam8-Feb-08 0:48 
QuestionDatabase's in vb.net Pin
Veldrain7-Feb-08 10:57
Veldrain7-Feb-08 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.