I did like:
FileStream fs = new FileStream(System.IO.Path.GetTempPath() + @"\MyTempDir" + listBox1.SelectedItem", FileMode.Create);
And you know what happens? It partly works. It opens the files (if its a pdf file, it opens in a acrobat reader, if doc it opens in word,...) but there is no file in that directory. listBox1.SelectedItem hold the full name of the file (like: "myFile.doc").
Strange, why is not there? The code go through well, it creates the file, but the file it is not shown in the specified (MyTempDir) folder.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
If I just simply declare the file name in the code like:
FileStream fs = new FileStream(System.IO.Path.GetTempPath() + @"\MyTempDir" + @"\myFile.doc", FileMode.Create);
It again creates the file but this time it even phisicly appears in the specified (MyTempDir) folder.
Why is there the difference between these two example?
Any ideas?