![]() |
|
12-20-2016
|
1 |
|
The Unwanted Critic
Join Date: Sep 2011
Posts: 3,639
|
Why can't a call a different constructor?(C#)
So I'm trying to run the following: PHP Code:
But I get the error "cannot convert from string to system.IO.Stream", pointing to fullPath when I try to pass it on to the constructor for StreamWriter. According to this there should be an overloaded constructor for it to create the object via a string: https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx So why does it tell me it expects a Stream object? Am I missing something? |
|
12-20-2016
|
2 |
|
Nerd
Join Date: Sep 2011
Location: Berlin
Posts: 3,825
|
I was able to pass a string in as a parameter successfully: PHP Code:
It's also worth mentioning that you can get rid of that loop and replace it with a call to WriteAllLines() if all you're doing is saving the contents of your array to a file ![]() PHP Code:
|