¡@

Home 

2014/10/15 ¤U¤È 10:08:25

iphone Programming Glossary: environment.specialfolder.personal

Write to a File in Monotouch

http://stackoverflow.com/questions/1829954/write-to-a-file-in-monotouch

iTunes when the user syncs. With MonoTouch you can get your app's Documents folder path with Environment.GetFolderPath Environment.SpecialFolder.Personal If you'd like to test it out this is some extremely simple code that'll write a file called out.txt to your app's Documents.. it work place it inside your AppDelegate's FinishedLaunching method in main.cs string path Environment.GetFolderPath Environment.SpecialFolder.Personal string filePath Path.Combine path out.txt File.WriteAllText will create a file and then write text to it. If the file already.. File.ReadAllText filePath Console.WriteLine text So the only thing here that's really iPhone specific is knowing that Environment.SpecialFolder.Personal maps to your app's Documents folder. Beyond that it's .Net as usual. And again this was probably overkill but I wanted to..