nunegandom
یک شنبه 22 مرداد 1391, 17:12 عصر
با سلام
این کد
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace Main
{
static class Program
{
/// <summary>
/// code[0] => "completed"
/// code[1] => filename with extention
/// </summary>
/// <param name="code">code[0] & code[1]</param>
[STAThread]
static void Main(string[] code)
{
if (code == null || code.Length == 0)
{
string _directory = Environment.CurrentDirectory;
Process.Start("cmd.exe", _directory+"\""+code[1]+" StartSplashing");
}
// else if (code[0] == "completed")
// {
Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState .NoneEnabled;
// Application.EnableVisualStyles();
// Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new MainForm());
// }
}
}
}
چطوری پارامتر به صورت آرایه ارسال کنم؟ حالا با CMD یا دستورات C# میخام از یک exe به یه exe دیگه پارامتر به این صورت بفرستم string[] و بعد از اون چطوری خونه ۱ و ۲ و ۳ شو تشخیص بدم؟
مثلا
code[0] code[1]
:لبخند: ممنون اگه کسی جوابی داره بده
این کد
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace Main
{
static class Program
{
/// <summary>
/// code[0] => "completed"
/// code[1] => filename with extention
/// </summary>
/// <param name="code">code[0] & code[1]</param>
[STAThread]
static void Main(string[] code)
{
if (code == null || code.Length == 0)
{
string _directory = Environment.CurrentDirectory;
Process.Start("cmd.exe", _directory+"\""+code[1]+" StartSplashing");
}
// else if (code[0] == "completed")
// {
Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState .NoneEnabled;
// Application.EnableVisualStyles();
// Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new MainForm());
// }
}
}
}
چطوری پارامتر به صورت آرایه ارسال کنم؟ حالا با CMD یا دستورات C# میخام از یک exe به یه exe دیگه پارامتر به این صورت بفرستم string[] و بعد از اون چطوری خونه ۱ و ۲ و ۳ شو تشخیص بدم؟
مثلا
code[0] code[1]
:لبخند: ممنون اگه کسی جوابی داره بده