- Home /
Question by
iamthecoolguy11 · Dec 03, 2014 at 04:30 AM ·
c#convert
Convert this from JavaScript to C#
lol this I cant figure out this part
function ReadFile(filepathIncludingFileName : String) {
sr = new File.OpenText(filepathIncludingFileName);
input = "";
while (true) {
input = sr.ReadLine();
if (input == null) { break; }
Debug.Log("line="+input);
}
if you need to see the rest of the script it is here
http://forum.unity3d.com/threads/can-i-read-and-write-text-files-using-javascript.5084/
Comment
i dont think anyone wants to write code for you.
http://answers.unity3d.com/questions/351442/write-and-read-text-files-with-c.html
You should try converting it yourself and post your code along with errors if there are any
Best Answer
Answer by HarshadK · Dec 03, 2014 at 05:56 AM
I guess this should be it:
void ReadFile(string filepathIncludingFileName) {
StreamReader sr = File.OpenText(filepathIncludingFileName)
string input = "";
while (true) {
input = sr.ReadLine();
if (input == null) { break; }
Debug.Log("line="+input);
}
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Please Help Convert js to c# 1 Answer
this script in Javascript?? 0 Answers