StreamReader doesn't take string?

0 Answers

get value from streamreader in c#

I'm trying to read a file with a StreamReader, but I get an error for using path

Argument 1: cannot convert from 'string' to System.IO.Stream

even though it's clear from the documentation, that you should be able to use a string.
What am I missing here?

public MyClass Load(String path)
        // exception in this line, `path` is underlined with red
        using (StreamReader reader = new StreamReader(path)) 
            String line = reader.ReadLine();
// ... etc