I've written my code in Python 3.6 and got the exe file using PyInstaller. My exe needs some files to run (like txt files to read the lines). When I put the exe file and the other files in same folder, exe file works perfectly.
But when I want to run the exe file with C#, it says that it can't find the other files even they are in same folder.
As I searched on here; I used this C# code;
using System.Diagnostics;
using System.IO;
namespace RunExeFile
{
class Program
{
static void Main(string[] args)
{
ProcessStartInfo _processStartInfo = new ProcessStartInfo();
_processStartInfo.WorkingDirectory = "C:\\Users\\wicaledon\\OneDrive\\Desktop\\Test\\";
_processStartInfo.FileName = @"Statistics.exe";
_processStartInfo.CreateNoWindow = true;
Process myProcess = Process.Start(_processStartInfo);
}
}
}
But it didn't work. How can I fix it?