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? |
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:
|
All times are GMT. The time now is 06:19 AM. |
Powered by vBulletin/Copyright ©2000 - 2024, vBulletin Solutions Inc.