StreamWriter outFile = File.CreateText ¬
    ("output1.txt");

In the above line of what, what is File. I see that StreamWriter is a class, outFile is our instance of that class, and CreateText would be a method. But what is the "File." before the CreateText method?

Normally when I have created any type of instance it's looked like this,

ClassName instance = new ClassName

Thing have gotten just a little bit more confusing without explanation. Thanks.

File is a static class in the System.IO namespace.
It has static methods that are used to manage files.
StreamWriter is also in the System.IO namespace.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.