Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to block website in Networkplace Pin
SilimSayo28-Oct-09 2:49
SilimSayo28-Oct-09 2:49 
General[Message Deleted] Pin
Mads11528-Oct-09 2:55
Mads11528-Oct-09 2:55 
GeneralRe: how to block website in Networkplace Pin
EliottA28-Oct-09 2:58
EliottA28-Oct-09 2:58 
General[Message Deleted] Pin
Mads11528-Oct-09 3:03
Mads11528-Oct-09 3:03 
GeneralRe: how to block website in Networkplace Pin
EliottA28-Oct-09 3:09
EliottA28-Oct-09 3:09 
GeneralRe: how to block website in Networkplace Pin
musefan28-Oct-09 3:50
musefan28-Oct-09 3:50 
QuestionDisplaying data records from database using any data presentation contol. Pin
santosh04228-Oct-09 0:36
santosh04228-Oct-09 0:36 
QuestionCannot upload chinese named file into Ftp server. Pin
Richard Htin27-Oct-09 23:51
Richard Htin27-Oct-09 23:51 
hi everyone,

I am facing big problem in Ftp upload function.

When I run following code for english named file uploading It's ok. No problem. But when i try for chinese named file. I got this error message.
"The remote server returned an error: (550) File unavailable (e.g., file not found, no access)."

Let me know if you have solution for me. Thanks in advance. Smile | :)

~~ This is my source code ~~
// Get the object used to communicate with the server.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("XXX" + Path.GetFileName(this.txtUploadFile.Text));
request.Method = WebRequestMethods.Ftp.UploadFile;

// This example assumes the FTP site uses anonymous logon.
request.Credentials = new NetworkCredential ("XXX","XXX");
request.UseBinary = true;
request.UsePassive = false;
request.KeepAlive = false;
            
// Copy the contents of the file to the request stream.
StreamReader sourceStream = new StreamReader(this.txtUploadFile.Text);
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());  

sourceStream.Close();
request.ContentLength = fileContents.Length;

Stream requestStream = request.GetRequestStream(); // Error occurring in here

requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();

FtpWebResponse response = (FtpWebResponse)request.GetResponse();


Richard

AnswerMessage Closed Pin
28-Oct-09 0:15
stancrm28-Oct-09 0:15 
AnswerRe: Cannot upload chinese named file into Ftp server. Pin
Richard Htin28-Oct-09 0:29
Richard Htin28-Oct-09 0:29 
QuestionHow to create something like unions in C#? Pin
CelestialCoder27-Oct-09 23:40
CelestialCoder27-Oct-09 23:40 
AnswerRe: How to create something like unions in C#? Pin
Christian Graus27-Oct-09 23:48
protectorChristian Graus27-Oct-09 23:48 
Questiontimers in windows service Pin
Chesnokov Yuriy27-Oct-09 23:26
professionalChesnokov Yuriy27-Oct-09 23:26 
AnswerRe: timers in windows service Pin
Covean27-Oct-09 23:38
Covean27-Oct-09 23:38 
AnswerRe: timers in windows service Pin
Chesnokov Yuriy27-Oct-09 23:49
professionalChesnokov Yuriy27-Oct-09 23:49 
GeneralRe: timers in windows service Pin
Sunil G 328-Oct-09 0:45
Sunil G 328-Oct-09 0:45 
AnswerRe: timers in windows service Pin
PIEBALDconsult28-Oct-09 11:39
mvePIEBALDconsult28-Oct-09 11:39 
Questionaccess outlook application Pin
nirmalsat27-Oct-09 23:18
nirmalsat27-Oct-09 23:18 
AnswerRe: access outlook application Pin
Christian Graus27-Oct-09 23:20
protectorChristian Graus27-Oct-09 23:20 
Questionhow to make a row bold in Excel using C# Pin
Bharti Vermani27-Oct-09 23:04
Bharti Vermani27-Oct-09 23:04 
AnswerRe: how to make a row bold in Excel using C# Pin
Christian Graus27-Oct-09 23:08
protectorChristian Graus27-Oct-09 23:08 
AnswerRe: how to make a row bold in Excel using C# Pin
Bharti Vermani27-Oct-09 23:20
Bharti Vermani27-Oct-09 23:20 
QuestionFormat string for fixed length real value in scientific representation? Pin
Mats Eurén27-Oct-09 22:42
Mats Eurén27-Oct-09 22:42 
AnswerRe: Format string for fixed length real value in scientific representation? Pin
Christian Graus27-Oct-09 23:03
protectorChristian Graus27-Oct-09 23:03 
GeneralRe: Format string for fixed length real value in scientific representation? Pin
Mats Eurén27-Oct-09 23:11
Mats Eurén27-Oct-09 23:11 

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.