Has the new update of Visual Studio causing glitches in apps at the moment???

  • Thread starter Thread starter Dazzz12345
  • Start date Start date
D

Dazzz12345

Guest
Hi just wondering if any one else has noticed any strange goings on with there apps since the newest update?


i had my app working and working really well but since the latest update some of my code just isn't working how it was.


I have noticed that my read and write calls to a text file has started to duplicate the write which it wasn't doing before. Now when I am writing to my Txt file instead of appending the TXT file it has started to overwrite the old text but also write it again in the TXT. Now i am losing the history of what has been typed in the past.


Maybe i have changed something and not noticed but it wasn't doing this before the update and my old versions of the code have also started behaving this way.

String Path = @"C:\Users\Public\Documents\Log.TXT";

if (!File.Exists(Path)) ;

else if (File.Exists(Path))


{
string createText = BodyTXT.text


File.WriteAllText(Path, createText);
}
string appendText = BodyTXT.text

File.AppendAllText(Path, appendText);




My call to this is on a different page


private void ViewLog_Click_1(object sender, RoutedEventArgs e)
{
string Path = @"C:\Users\Public\Documents\Log.TXT";

if (!File.Exists(Path)) ;

else if (File.Exists(Path))

{
string createText;
}
Window1 win = new Window1();
win.Show();
this.Close();



and my read

InitializeComponent();


String File_name = "C:\\Users\\Public\\Documents\\Log.txt";
if (System.IO.File.Exists(File_name) == true)
{
System.IO.StreamReader objReader;
objReader = new StreamReader(File_name);
QuoteLog.Text = objReader.ReadToEnd();
objReader.Close();


What I have also noticed is that when I write to the same TXT file from a different page

it again replaces what has previously been in the text and doesn't append the TXT file not sure if that is possible but I have basically have used the same code in the second page so.


if anyone has any insight on what is now going on would be great as the app now just doesn't work as it was a couple of days ago

Continue reading...
 
Back
Top