Read and Write to text file Online


I have created a text file to store a few numbers. I just want to be able to read these numbers from the program at runtime. Also want to write to it at runtime.

Any ideas?

Thanks, Chris

You can read and write text files as long as you store them on a server online, rather than locally.

you can use an online file with it's url but you can not use local files. i did not test if works well with online files or not. you can use PHP scripts and www class to read/write the file. using online databases is possible too. take a look at

Not happening - it's a security issue. Webplayer distributions are not be allowed to write to the local filesystem.

You can read more on this answer.

Perhaps what you can can be accomplished with the use of preferences.

I was trying to do this, and I found an easier way. If you really just want to store “a few numbers”, you’re probably better off using the PlayerPrefs methods than using a server.

Using this, you can store and retrieve floats, strings, and ints assosciated with some name, for instance: PlayerPrefs.SetInt("High Score", score);