Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
AnswerRe: Right to left in listbox Pin
Nafiseh Salmani18-Sep-06 23:34
Nafiseh Salmani18-Sep-06 23:34 
QuestionC# and SCSI tape drive Pin
Dima Statz12-Aug-06 22:25
Dima Statz12-Aug-06 22:25 
AnswerRe: C# and SCSI tape drive Pin
amini_porroo2-May-12 0:23
amini_porroo2-May-12 0:23 
Questionlistbox Pin
Nafiseh Salmani12-Aug-06 20:41
Nafiseh Salmani12-Aug-06 20:41 
QuestionRe: listbox Pin
CooperWu12-Aug-06 23:48
CooperWu12-Aug-06 23:48 
AnswerRe: listbox Pin
Nafiseh Salmani13-Aug-06 0:21
Nafiseh Salmani13-Aug-06 0:21 
Questionselecting columns to use in a dataview [modified] Pin
Glen Harvy12-Aug-06 17:37
Glen Harvy12-Aug-06 17:37 
QuestionDownlaod a text file in C# Pin
nmandaliya12-Aug-06 11:56
nmandaliya12-Aug-06 11:56 
Hi friends,
I have one use control, which have one DATAGRID and control to uplaod (HTML where input type=file). When you upload file, (1) it will save file in the server folder (2) shows in the GRID within LinkButton. So one click on the linkbutton (FileName), able to save/Open file.
Code for this is.
----------------------------------------------------------------
FileStream MyFileStream = new FileStream(baseAttachementsPath + FileToOpen , FileMode.Open ,FileAccess.Read,FileShare.Read);
long FileSize;
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
int bytesRead = MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);
MyFileStream.Close();
Response.Buffer=true;
Response.Clear();
Response.Charset = "UTF-8";
Response.ContentType = "application/octet-stream"; Response.AppendHeader("content-length", FileSize.ToString() );
Response.AddHeader( "content-disposition","attachment; filename=" + FileToOpen);
Response.Flush();
Response.BinaryWrite(Buffer);
Response.End();
-------------------------------------------------------------------------
So this code is working for all file but not for text file.
When we try to open the text file, it will have all content with the source code for page. (source code is that for my current .aspx, and if i do view->source)
so if i have data in text file is "TEST FILE",
so when try to open / save ..
it contains...
==========
Test File
meta content=http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema>


<title>HP Direct Customer Addresses Registration Form

etc....
==================
Code is giving only for TEXT, else for DOC,PDF,xls working fine.

Can you help me?

Thanks in advance..



naishadh
QuestionDownlaod a text file in C# Pin
nmandaliya12-Aug-06 11:54
nmandaliya12-Aug-06 11:54 
AnswerRe: Downlaod a text file in C# Pin
Insincere Dave12-Aug-06 15:36
Insincere Dave12-Aug-06 15:36 
GeneralRe: Downlaod a text file in C# Pin
nmandaliya13-Aug-06 20:00
nmandaliya13-Aug-06 20:00 
QuestionMS Agent Characters are not Talking NowAdays.... [modified] Pin
emran83412-Aug-06 11:29
emran83412-Aug-06 11:29 
AnswerRe: MS Agent Characters are not Talking NowAdays.... Pin
Rob Graham13-Aug-06 4:04
Rob Graham13-Aug-06 4:04 
GeneralRe: MS Agent Characters are not Talking NowAdays.... Pin
emran83413-Aug-06 6:44
emran83413-Aug-06 6:44 
QuestionPanel control does not update the position correctly [modified] Pin
Ista12-Aug-06 11:22
Ista12-Aug-06 11:22 
QuestionAdd html file to resource, and show it from there Pin
peterchen12-Aug-06 11:08
peterchen12-Aug-06 11:08 
AnswerRe: Add html file to resource, and show it from there Pin
Stefan Troschuetz12-Aug-06 11:43
Stefan Troschuetz12-Aug-06 11:43 
QuestionStrange .length of a string Pin
Stick^12-Aug-06 9:55
Stick^12-Aug-06 9:55 
AnswerRe: Strange .length of a string Pin
Guffa12-Aug-06 10:08
Guffa12-Aug-06 10:08 
GeneralRe: Strange .length of a string Pin
Stick^12-Aug-06 10:27
Stick^12-Aug-06 10:27 
Questionpublic variable Pin
md_refay12-Aug-06 9:46
md_refay12-Aug-06 9:46 
AnswerRe: public variable Pin
Ista12-Aug-06 10:01
Ista12-Aug-06 10:01 
AnswerRe: public variable Pin
Judah Gabriel Himango12-Aug-06 11:04
sponsorJudah Gabriel Himango12-Aug-06 11:04 
Questionbitmap being dragged does not appear as the actual size Pin
Ista12-Aug-06 9:45
Ista12-Aug-06 9:45 
AnswerRe: bitmap being dragged does not appear as the actual size Pin
Ista12-Aug-06 10:34
Ista12-Aug-06 10:34 

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.