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

C#

 
Questionproxi authentification Pin
Camilo Sanchez15-Dec-05 4:26
Camilo Sanchez15-Dec-05 4:26 
AnswerRe: proxi authentification Pin
S. Senthil Kumar15-Dec-05 4:46
S. Senthil Kumar15-Dec-05 4:46 
GeneralRe: proxi authentification Pin
Camilo Sanchez28-Dec-05 13:14
Camilo Sanchez28-Dec-05 13:14 
QuestionReading from Network & Writing Contents to a Local File Pin
farhan197615-Dec-05 4:24
farhan197615-Dec-05 4:24 
QuestionDataView not returning the correct rows Pin
gashach15-Dec-05 3:51
gashach15-Dec-05 3:51 
QuestionFile.Create method isn't releasing the file Pin
kornstyle15-Dec-05 3:26
kornstyle15-Dec-05 3:26 
AnswerRe: File.Create method isn't releasing the file Pin
Ingo15-Dec-05 3:49
Ingo15-Dec-05 3:49 
AnswerRe: File.Create method isn't releasing the file Pin
Polis Pilavas15-Dec-05 3:51
Polis Pilavas15-Dec-05 3:51 
What code are you using? I suspect that you didn't call the Close() method right after you created the file. We can't do much without seeing the actual code you use. But anyways, here's a sample code I use when creating/writing text files:

FileStream <code>fs</code> = null;
string <code>tmpFile</code> = "C:\\sample.txt";

// Create file  and close it so that it can be re-opened for writing further on
<code>fs</code> = File.Create(<code>tmpFile</code>, 1024);
<code>fs.Close();</code>

// Prepare file  for writing by assigning a new textWriter to it
TextWriter <code>wr</code> = new StreamWriter(<code>tmpFile</code>);

// Write stuff into the file
<code>wr.WriteLine("Stuff 1");
wr.WriteLine("Stuff 2");
wr.WriteLine("Blah blah blah......");</code>

// Eventually close the file
<code>wr.Close();</code>


Regards,
Polis

Can you practice what you teach?

-- modified at 9:53 Thursday 15th December, 2005
QuestionChanging Screen Resolution through C# Pin
thepolishguy15-Dec-05 3:19
thepolishguy15-Dec-05 3:19 
AnswerRe: Changing Screen Resolution through C# Pin
Andy Moore15-Dec-05 3:35
Andy Moore15-Dec-05 3:35 
AnswerRe: Changing Screen Resolution through C# Pin
Dave Kreskowiak15-Dec-05 6:18
mveDave Kreskowiak15-Dec-05 6:18 
GeneralRe: Changing Screen Resolution through C# Pin
Dan Neely16-Dec-05 3:16
Dan Neely16-Dec-05 3:16 
Questionfaxing from C# via Send Fax Wizard Pin
cobra200515-Dec-05 3:00
cobra200515-Dec-05 3:00 
AnswerRe: faxing from C# via Send Fax Wizard Pin
albCode15-Dec-05 6:13
albCode15-Dec-05 6:13 
GeneralRe: faxing from C# via Send Fax Wizard Pin
cobra200515-Dec-05 6:31
cobra200515-Dec-05 6:31 
GeneralRe: faxing from C# via Send Fax Wizard Pin
albCode15-Dec-05 6:43
albCode15-Dec-05 6:43 
GeneralRe: faxing from C# via Send Fax Wizard Pin
cobra200515-Dec-05 8:02
cobra200515-Dec-05 8:02 
QuestionChanging all cursor types on a form Pin
fracalifa15-Dec-05 2:51
fracalifa15-Dec-05 2:51 
AnswerRe: Changing all cursor types on a form Pin
Polis Pilavas15-Dec-05 3:41
Polis Pilavas15-Dec-05 3:41 
GeneralRe: Changing all cursor types on a form Pin
fracalifa15-Dec-05 5:50
fracalifa15-Dec-05 5:50 
QuestionExtend NumericUpDown Pin
yala15-Dec-05 1:43
yala15-Dec-05 1:43 
QuestionDatabase migration tool Pin
AnonymousTwo15-Dec-05 1:34
AnonymousTwo15-Dec-05 1:34 
QuestionPreprocessKEy message DATAGRID column Pin
Greeky15-Dec-05 0:40
Greeky15-Dec-05 0:40 
QuestionExcel in C# Pin
Mahi.Ragava15-Dec-05 0:27
Mahi.Ragava15-Dec-05 0:27 
Questionevent handling Pin
Ankit Aneja14-Dec-05 23:34
Ankit Aneja14-Dec-05 23: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.