Click here to Skip to main content
15,905,316 members
Home / Discussions / C#
   

C#

 
QuestionKEYPRESS SPY Pin
nelsonpaixao31-Aug-08 13:18
nelsonpaixao31-Aug-08 13:18 
AnswerRe: KEYPRESS SPY Pin
Sunset Towers31-Aug-08 13:55
Sunset Towers31-Aug-08 13:55 
AnswerRe: KEYPRESS SPY Pin
Harvey Saayman31-Aug-08 20:44
Harvey Saayman31-Aug-08 20:44 
GeneralRe: KEYPRESS SPY Pin
nelsonpaixao1-Sep-08 12:49
nelsonpaixao1-Sep-08 12:49 
QuestionEditing Registry For Default Browser Pin
Abydosgater31-Aug-08 13:18
Abydosgater31-Aug-08 13:18 
QuestionVisual Studio 2008 Report Viewer Pin
Jacob Dixon31-Aug-08 12:58
Jacob Dixon31-Aug-08 12:58 
AnswerRe: Visual Studio 2008 Report Viewer Pin
Jacob Dixon1-Sep-08 2:31
Jacob Dixon1-Sep-08 2:31 
QuestionWriting to a file at the specified position Pin
jacobjordan31-Aug-08 11:00
jacobjordan31-Aug-08 11:00 
I am trying to make something that will write data to a file at the specified position using the IO.StreamWriter class. Here is what i have
public static void EncodeData(string Data, string Path, long Index)
{
    StreamWriter stream = new StreamWriter(Path, true);
    stream.BaseStream.Position = Index;
    stream.Write(Data);
    stream.Close();
}

Problem is, that throws an exception that says "Unable seek backward to overwrite data that previously existed in a file opened in Append mode.". When i open the file so it's not in append mode, it will write at the specified position, but it will override the entire file. Just to be clear, i want this to insert the data, without overriding anything.


void Play() { try { throw Ball(); } catch (Glove) { } finally { Play(); } }

"Failure is only the opportunity to begin again, this time more wisely."
"Don't ask for a light load, but rather ask for a strong back."

AnswerRe: Writing to a file at the specified position Pin
Wendelius31-Aug-08 11:07
mentorWendelius31-Aug-08 11:07 
GeneralRe: Writing to a file at the specified position Pin
jacobjordan31-Aug-08 11:29
jacobjordan31-Aug-08 11:29 
GeneralRe: Writing to a file at the specified position Pin
Wendelius31-Aug-08 11:45
mentorWendelius31-Aug-08 11:45 
Questiontime Pin
NiloofarNoroozi31-Aug-08 10:34
NiloofarNoroozi31-Aug-08 10:34 
AnswerRe: time Pin
Dr. Emmett Brown31-Aug-08 10:54
Dr. Emmett Brown31-Aug-08 10:54 
AnswerRe: time Pin
User 665831-Aug-08 10:54
User 665831-Aug-08 10:54 
AnswerRe: time Pin
Blue_Boy31-Aug-08 12:49
Blue_Boy31-Aug-08 12:49 
AnswerRe: time Pin
Christian Graus31-Aug-08 13:04
protectorChristian Graus31-Aug-08 13:04 
GeneralRe: time Pin
Harvey Saayman31-Aug-08 20:45
Harvey Saayman31-Aug-08 20:45 
GeneralRe: time Pin
Roger Alsing31-Aug-08 22:00
Roger Alsing31-Aug-08 22:00 
GeneralRe: time Pin
Mark Churchill31-Aug-08 22:09
Mark Churchill31-Aug-08 22:09 
GeneralRe: time Pin
Kevin Marois2-Sep-08 7:23
professionalKevin Marois2-Sep-08 7:23 
AnswerGet out of programming... Pin
leckey31-Aug-08 15:34
leckey31-Aug-08 15:34 
QuestionMDI Form Menu problem in C# windows application Pin
fqn31-Aug-08 9:26
fqn31-Aug-08 9:26 
AnswerRe: MDI Form Menu problem in C# windows application Pin
Wendelius31-Aug-08 9:38
mentorWendelius31-Aug-08 9:38 
QuestionSplitting a list into seperate threads. Pin
Buckleyindahouse31-Aug-08 9:08
Buckleyindahouse31-Aug-08 9:08 
QuestionRe: Splitting a list into seperate threads. Pin
Mark Salsbery31-Aug-08 9:49
Mark Salsbery31-Aug-08 9: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.