Answered by:
Writing data to a text file from windows store app

Question
-
Hi,
I need to write data to a text file from windows store app which resides in my application.
Can somebody help.
Regards,
Naveen
Tuesday, October 1, 2013 3:03 PM
Answers
-
Hi Naveen,
find out more about reading/writing files here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh758325.aspx
and here:
http://msdn.microsoft.com/en-us/library/windows/apps/jj150593.aspx
How you can access a file from your Application you can read here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx
If this information doesn't solve your problem, please come back. :-)
Thomas Claudius Huber
"If you can´t make your app run faster, make it at least look & feel extremly fast"
twitter: @thomasclaudiush
homepage: www.thomasclaudiushuber.com
author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, October 15, 2013 8:05 AM
Tuesday, October 1, 2013 6:56 PM -
In addition to the documentation Thomas linked take a look at the File access sample (Windows 8)
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, October 15, 2013 8:05 AM
Tuesday, October 1, 2013 7:03 PMModerator -
Hello Naveen,
Try this:
StorageFile file1 = await ApplicationData.Current.LocalFolder.CreateFileAsync("filename.txt", CreationCollisionOption.ReplaceExisting); await FileIO.WriteTextAsync(file1, "Your data");
uisng this you can create or replace file & write data to this file.
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, October 15, 2013 8:05 AM
Wednesday, October 2, 2013 4:22 AM
All replies
-
Hi Naveen,
find out more about reading/writing files here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh758325.aspx
and here:
http://msdn.microsoft.com/en-us/library/windows/apps/jj150593.aspx
How you can access a file from your Application you can read here:
http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx
If this information doesn't solve your problem, please come back. :-)
Thomas Claudius Huber
"If you can´t make your app run faster, make it at least look & feel extremly fast"
twitter: @thomasclaudiush
homepage: www.thomasclaudiushuber.com
author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, October 15, 2013 8:05 AM
Tuesday, October 1, 2013 6:56 PM -
In addition to the documentation Thomas linked take a look at the File access sample (Windows 8)
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, October 15, 2013 8:05 AM
Tuesday, October 1, 2013 7:03 PMModerator -
Hello Naveen,
Try this:
StorageFile file1 = await ApplicationData.Current.LocalFolder.CreateFileAsync("filename.txt", CreationCollisionOption.ReplaceExisting); await FileIO.WriteTextAsync(file1, "Your data");
uisng this you can create or replace file & write data to this file.
- Marked as answer by Xiaoliang Chen - MSFTModerator Tuesday, October 15, 2013 8:05 AM
Wednesday, October 2, 2013 4:22 AM