Your question doesn't make much sense, but there are some possible problems if the code you posted is your complete code.
Your StreamReader is called read , but are you trying to read from a stream named oku ?
In addition, you did not show that you are actually closing the StreamReader, you would be better of using a block StreamReader, you would be better of using a using` to make sure that your stream is correctly closed and deleted.
using (StreamReader read = new StreamReader(Environment.GetEnvironmentVariable("appdata") + "\\path.txt")) { string path = read.ReadLine(); string processname = Path.GetFileName("notepad"); if (processIsRunning(processname) == false) { System.Diagnostics.Process.Start(path); } }
source share