[Solved] Open a file in c# [closed]


All that your code this is create a FileStream pointing to this file. So you could read the file and fetch its contents in memory. But you cannot expect it to open in any browser. You could use the Process.Start method to open the file using the default program that is associated with this file type:

foreach (System.IO.FileInfo thefile in fiArr)
{
    if (thefile.Name == "index.html")
    {
        Process.Start(thefile.Name);
    }
}

1

solved Open a file in c# [closed]