Forum ‹ C# ‹ Reading and Writing to text files
3 posts
• Page 1 of 1
Reading and Writing to text files
Hello,
There seems to be a problem with the following methods:
FileInfo theSourceFile = null;
or
System.IO.FileStream fileStream = new System.IO.FileStream("chathistoryb.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite, System.IO.FileShare.None);
System.IO.StreamReader sr = new System.IO.StreamReader("chathistoryb.txt");
System.IO.StreamWriter sw = new System.IO.StreamWriter("chathistoryb.txt");
When I try to use it I get this outputted on the server:
error: MushroomsUnity3DExample.GameCode.GotMessage(...) has varible of the non-allowed type: System.IO.FileInfo
I'm trying to save chat messages to a text file on the servers side and then load the messages back to everyone once they log back in.
Is there special way to read/write to text files with player io?
Thanks
There seems to be a problem with the following methods:
FileInfo theSourceFile = null;
or
System.IO.FileStream fileStream = new System.IO.FileStream("chathistoryb.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite, System.IO.FileShare.None);
System.IO.StreamReader sr = new System.IO.StreamReader("chathistoryb.txt");
System.IO.StreamWriter sw = new System.IO.StreamWriter("chathistoryb.txt");
When I try to use it I get this outputted on the server:
error: MushroomsUnity3DExample.GameCode.GotMessage(...) has varible of the non-allowed type: System.IO.FileInfo
I'm trying to save chat messages to a text file on the servers side and then load the messages back to everyone once they log back in.
Is there special way to read/write to text files with player io?
Thanks
- deadbug
- Posts: 12
- Joined: November 1st, 2011, 1:35 am
Re: Reading and Writing to text files
The "problem" is that we do not allow you to touch the filesystem on the servers in any way whatsoever.
If you want to persist data you should use the BigDB service: http://playerio.com/documentation/refer ... rary.bigdb
If you want to persist data you should use the BigDB service: http://playerio.com/documentation/refer ... rary.bigdb
-

Henrik - .IO
- Posts: 570
- Joined: January 4th, 2010, 1:53 pm
Re: Reading and Writing to text files
Thank you,
I manged to set up a table to store the needed info and it works. I cant really keep track of single messages as their own thing but I can keep track of the number of messages.
I manged to set up a table to store the needed info and it works. I cant really keep track of single messages as their own thing but I can keep track of the number of messages.
- deadbug
- Posts: 12
- Joined: November 1st, 2011, 1:35 am
3 posts
• Page 1 of 1