Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Socket programming with linux machine. Pin
PIEBALDconsult26-Jul-10 7:21
mvePIEBALDconsult26-Jul-10 7:21 
AnswerRe: Resolved C# Socket programming with linux machine. Pin
jobin00700727-Jul-10 5:33
jobin00700727-Jul-10 5:33 
QuestionWindows or Console application target for Windows Service? Pin
JoeSchmoe00726-Jul-10 3:43
JoeSchmoe00726-Jul-10 3:43 
AnswerRe: Windows or Console application target for Windows Service? Pin
darkelv26-Jul-10 4:04
darkelv26-Jul-10 4:04 
AnswerRe: Windows or Console application target for Windows Service? [modified] Pin
PIEBALDconsult26-Jul-10 6:55
mvePIEBALDconsult26-Jul-10 6:55 
QuestionMouse Hover/Leave with many controls and status strip message Pin
Blubbo26-Jul-10 3:05
Blubbo26-Jul-10 3:05 
AnswerRe: Mouse Hover/Leave with many controls and status strip message Pin
Blubbo26-Jul-10 4:16
Blubbo26-Jul-10 4:16 
QuestionFTP transfer corrupts .PNG files Pin
anthasaurus26-Jul-10 2:06
anthasaurus26-Jul-10 2:06 
Hi,

After transferring PNG images to an FTP server, I am unable to open them as they are being corrupted. My code is as below:

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://... etc.");
request.UsePassive = true;
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential("username", "password");

StreamReader sourceStream = new StreamReader(fileLocalDir);
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
sourceStream.Close();
request.ContentLength = fileContents.Length;

Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();

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



Another thing to add - when I download the file from the FTP server and open in IrfanView, the error below is displayed:

"C:\Folder\file.png: Can't read file header! Unknown file format or file not found! (For unicode file names, please activate the Unicode PlugIn in 'Properties -> Languages')"


Thanks for any assistance,
Anthony.
AnswerRe: FTP transfer corrupts .PNG files Pin
Nagy Vilmos26-Jul-10 2:18
professionalNagy Vilmos26-Jul-10 2:18 
GeneralRe: FTP transfer corrupts .PNG files Pin
anthasaurus26-Jul-10 23:10
anthasaurus26-Jul-10 23:10 
QuestionSelection Formula in crystal report Pin
Nikhil Bhivgade26-Jul-10 1:21
professionalNikhil Bhivgade26-Jul-10 1:21 
QuestionWhat API to use? Pin
c242326-Jul-10 0:54
c242326-Jul-10 0:54 
AnswerRe: What API to use? Pin
Eddy Vluggen26-Jul-10 1:19
professionalEddy Vluggen26-Jul-10 1:19 
GeneralRe: What API to use? Pin
c242326-Jul-10 1:28
c242326-Jul-10 1:28 
GeneralRe: What API to use? Pin
Eddy Vluggen26-Jul-10 1:41
professionalEddy Vluggen26-Jul-10 1:41 
GeneralRe: What API to use? Pin
c242326-Jul-10 3:08
c242326-Jul-10 3:08 
GeneralRe: What API to use? Pin
Eddy Vluggen26-Jul-10 3:11
professionalEddy Vluggen26-Jul-10 3:11 
GeneralRe: What API to use? PinPopular
Pete O'Hanlon26-Jul-10 3:51
mvePete O'Hanlon26-Jul-10 3:51 
GeneralRe: What API to use? Pin
c242326-Jul-10 5:32
c242326-Jul-10 5:32 
Questionbackground image for richtextbox like watermark Pin
mobasher26-Jul-10 0:45
mobasher26-Jul-10 0:45 
AnswerRe: background image for richtextbox like watermark Pin
Ravi Bhavnani26-Jul-10 2:00
professionalRavi Bhavnani26-Jul-10 2:00 
GeneralRe: background image for richtextbox like watermark Pin
mobasher26-Jul-10 2:50
mobasher26-Jul-10 2:50 
AnswerRe: background image for richtextbox like watermark Pin
Eddy Vluggen26-Jul-10 3:36
professionalEddy Vluggen26-Jul-10 3:36 
QuestionOn drawing rectangle how to scroll down the picture box? Pin
Nivas8226-Jul-10 0:30
Nivas8226-Jul-10 0:30 
Questionupdate panel in content page works just on first time click? Pin
220825-Jul-10 23:49
220825-Jul-10 23:49 

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.