Click here to Skip to main content
14,302,596 members
   

C#

 
AnswerRe: Ask C# everyone God, about SQLiteHelper increase delete to modify the static to directly call the way Pin
#realJSOP30-May-19 4:55
mve#realJSOP30-May-19 4:55 
GeneralRe: Ask C# everyone God, about SQLiteHelper increase delete to modify the static to directly call the way Pin
Eddy Vluggen30-May-19 7:20
mveEddy Vluggen30-May-19 7:20 
GeneralRe: Ask C# everyone God, about SQLiteHelper increase delete to modify the static to directly call the way Pin
#realJSOP30-May-19 7:24
mve#realJSOP30-May-19 7:24 
PraiseRe: Ask C# everyone God, about SQLiteHelper increase delete to modify the static to directly call the way Pin
Eddy Vluggen30-May-19 7:29
mveEddy Vluggen30-May-19 7:29 
SuggestionRe: Ask C# everyone God, about SQLiteHelper increase delete to modify the static to directly call the way Pin
Richard Deeming30-May-19 7:46
mveRichard Deeming30-May-19 7:46 
GeneralRe: Ask C# everyone God, about SQLiteHelper increase delete to modify the static to directly call the way Pin
#realJSOP1-Jun-19 5:02
mve#realJSOP1-Jun-19 5:02 
QuestionFile keeps getting corrupted on just one machine Pin
jkirkerx29-May-19 12:51
professionaljkirkerx29-May-19 12:51 
AnswerRe: File keeps getting corrupted on just one machine PinPopular
Dave Kreskowiak29-May-19 13:11
mveDave Kreskowiak29-May-19 13:11 
Change your call to File.OpenWrite to:
Using jsonStream = New FileStream(appPath, FileMode.Create, FileAccess.Write)


What your code is doing with File.OpenWrite is opening a file with FileMode.OpenOrCreate, which will NOT completely overwrite the content of the file. It will open an existing file AND KEEP THE CONTENT IN IT for write.

Your code is failing because the file you're writing used to be at least one character longer than what you're writing now. When you write the new content of the file, only the bytes up to the Length of the content you're writing are overwritten. The remaining original content of the file remains intact.

Changing the FileMode to Create opens the file, but truncates the content so everything in the existing file is removed. Read up on it here[^].

Then go read up on creating a FileStream[^].

GeneralRe: File keeps getting corrupted on just one machine Pin
jkirkerx29-May-19 13:17
professionaljkirkerx29-May-19 13:17 
AnswerRe: File keeps getting corrupted on just one machine Pin
Dave Kreskowiak29-May-19 13:13
mveDave Kreskowiak29-May-19 13:13 
GeneralRe: File keeps getting corrupted on just one machine Pin
jkirkerx29-May-19 13:25
professionaljkirkerx29-May-19 13:25 
QuestionDownload files Pin
Member 1447263829-May-19 0:23
memberMember 1447263829-May-19 0:23 
AnswerRe: Download files Pin
#realJSOP29-May-19 0:36
mve#realJSOP29-May-19 0:36 
AnswerRe: Download files Pin
Pete O'Hanlon29-May-19 0:42
protectorPete O'Hanlon29-May-19 0:42 
GeneralRe: Download files Pin
Member 1447263829-May-19 3:12
memberMember 1447263829-May-19 3:12 
GeneralRe: Download files Pin
OriginalGriff29-May-19 3:14
protectorOriginalGriff29-May-19 3:14 
GeneralRe: Download files Pin
Pete O'Hanlon29-May-19 3:36
protectorPete O'Hanlon29-May-19 3:36 
Questiondownload files Pin
Member 1447263829-May-19 1:30
memberMember 1447263829-May-19 1:30 
QuestionRe: download files Pin
Richard MacCutchan28-May-19 21:11
protectorRichard MacCutchan28-May-19 21:11 
AnswerRe: download files Pin
Member 1447263829-May-19 0:23
memberMember 1447263829-May-19 0:23 
GeneralRe: download files Pin
Richard MacCutchan29-May-19 1:35
protectorRichard MacCutchan29-May-19 1:35 
AnswerRe: download files Pin
Richard Deeming29-May-19 0:42
mveRichard Deeming29-May-19 0:42 
QuestionC# using get set. Why is this failing? Pin
Brian_TheLion28-May-19 19:52
memberBrian_TheLion28-May-19 19:52 
AnswerRe: C# using get set. Why is this failing? Pin
Member 1356638328-May-19 20:14
memberMember 1356638328-May-19 20:14 
GeneralRe: C# using get set. Why is this failing? Pin
Brian_TheLion28-May-19 20:22
memberBrian_TheLion28-May-19 20:22 

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.