help
Root Question Message
using System;
namespace Program
{
class Prog
{
public static void Main(string[] args)
{
if (!File.Exists(@"C:\Test"))
{
Directory.CreateDirectory(@"C:\Test");
//What I dont know
///
/// The .py file (pyfile.py) gets put into the C:\Test directory
////
///I believe even if you have multiple files in visual studio it compiles them into 1 exe? Will this effect the .py file getting put into the directory?
}
}
}
}
string[] resourceNames = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
string yourLikelyPythonFilePath = resourceNames.FirstOrDefault(name => name.Contains("pyfile.py"));
if (yourLikelyPythonFilePath == null)
{
throw new Exception("Could not find the python file in the resources");
}
System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(yourLikelyPythonFilePath);
using (System.IO.FileStream fileStream = new System.IO.FileStream("pyfile.py", System.IO.FileMode.Create, System.IO.FileAccess.Write))
{
stream.CopyTo(fileStream);
}
resourceNames.FirstOrDefault(name => name.Contains("pyfile.py"));
using System.Linq;
as well so, completely pointlessnew System.IO.FileStream("pyfile.py"...