public static void Main(string[] args) { /* * ex_txn is meant to be run from build_windows\AnyCPU, * in either the Debug or Release directory. The * required core libraries, however, are in either * build_windows\Win32 or build_windows\x64, depending * upon the platform. That location needs to be added * to the PATH environment variable for the P/Invoke * calls to work. */ try { String pwd = Environment.CurrentDirectory; pwd = Path.Combine(pwd, ".."); pwd = Path.Combine(pwd, ".."); pwd = Path.Combine(pwd, ".."); pwd = Path.Combine(pwd, "build_windows"); if (IntPtr.Size == 4) { pwd = Path.Combine(pwd, "Win32"); } else { pwd = Path.Combine(pwd, "x64"); } #if DEBUG pwd = Path.Combine(pwd, "Debug"); #else pwd = Path.Combine(pwd, "Release"); #endif pwd += ";" + Environment.GetEnvironmentVariable("PATH"); Environment.SetEnvironmentVariable("PATH", pwd); } catch (Exception e) { Console.WriteLine( "Unable to set the PATH environment variable."); Console.WriteLine(e.Message); return; } ex_txn obj = new ex_txn(); obj.RunExample(args); }
public static void Main(string[] args) { /* * ex_txn is meant to be run from build_windows\AnyCPU, * in either the Debug or Release directory. The * required core libraries, however, are in either * build_windows\Win32 or build_windows\x64, depending * upon the platform. That location needs to be added * to the PATH environment variable for the P/Invoke * calls to work. */ try { String pwd = Environment.CurrentDirectory; pwd = Path.Combine(pwd, ".."); pwd = Path.Combine(pwd, ".."); pwd = Path.Combine(pwd, ".."); pwd = Path.Combine(pwd, "build_windows"); if (IntPtr.Size == 4) pwd = Path.Combine(pwd, "Win32"); else pwd = Path.Combine(pwd, "x64"); #if DEBUG pwd = Path.Combine(pwd, "Debug"); #else pwd = Path.Combine(pwd, "Release"); #endif pwd += ";" + Environment.GetEnvironmentVariable("PATH"); Environment.SetEnvironmentVariable("PATH", pwd); } catch (Exception e) { Console.WriteLine( "Unable to set the PATH environment variable."); Console.WriteLine(e.Message); return; } ex_txn obj = new ex_txn(); obj.RunExample(args); }