File creation

In this chapter you will learn:

  1. Create new files

Creating Files

using System;//  j  a  v  a 2  s. com
using System.IO;

public class MainClass
{
  public static void Main()
  {
    FileInfo MyFile = new FileInfo(@"c:\Test.txt");

    MyFile.Create();
  }
}

Next chapter...

What you will learn in the next chapter:

  1. How to delete files
Home » C# Tutorial » File, Path
File creation
Deleting Files
Put to recycle bin
File Exists
File moving
File size
File attribute
Set file attribute
File time change
File time
Random file name
Temporary file
Path
Directory creation
Delete directory
Path existance
Change the path
Current Path
Directory listing
Recursive Path Listing
Combine path
Calculate Directory Size
Invalid path characters
System path
Directory copy
Drive
Drive information
File access rule
File System watcher