powered by simpleCommunicator - 2.0.49     © 2025 Programmizd 02
Форумы / Программирование [игнор отключен] [закрыт для гостей] / Помогите автостаротом программы с флешки на Windows 10?
1 сообщений из 1, страница 1 из 1
Помогите автостаротом программы с флешки на Windows 10?
    #39702289
Dzordz2
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Я использовал Windows Form application на С#, inf, int для автостарта программы и .reg чтобы программа стартовала при нажатие правой клавиши по иконке.

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace dzordz_1._0._0._0__
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnFolder_Click(object sender, EventArgs e)
        {
            //Select folder
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            fbd.Description = "Select your path.";
            if (fbd.ShowDialog() == DialogResult.OK)
                txtFolder.Text = fbd.SelectedPath;
        }



        private void btnZipFolder_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtFolder.Text))
            {
                MessageBox.Show("Please select your folder.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtFolder.Focus();
                return;
            }
            string path = txtFolder.Text;
            //Zip folder & update progress bar
            Thread thread = new Thread(t =>
            {
                using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile())
                {
                    zip.AddDirectory(path);
                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path);
                    zip.SaveProgress += Zip_SaveProgress;
                    zip.Save(string.Format(".paq8o", di.Parent.FullName, di.Name));
                }
            }) { IsBackground = true };
            thread.Start();
        }

        private void Zip_SaveProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
        {
            if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_BeforeWriteEntry)
            {
                progressBar.Invoke(new MethodInvoker(delegate
                {
                    progressBar.Maximum = e.EntriesTotal;
                    progressBar.Value = e.EntriesSaved + 1;
                    progressBar.Update();
                }));
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
      
}
//вот здесь я отметил. Почему программа не стартует с флешки?
//.inf
[autorun]
Label=MOSM
ICON=cluster32.ico
;Open=Smallint.exe
ShellExecute=Smallint.exe
UseAutoPlay=1

//.ini
[autorun]
;Open=E:\\Smallint.exe
ShellExecute=E:\\Smallint.exe
UseAutoPlay=1
////

//.reg
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Smallint]
"Icon"="C:\\Program Files\\Smallint\\cluster32.ico"
@=""

[HKEY_CLASSES_ROOT\*\shell\Smallint\command]
@="C:\\Program Files\\Smallint\\Smallint.exe \"%1\""

[HKEY_CLASSES_ROOT\.Smallint]
@="Smallint"

[HKEY_CLASSES_ROOT\Smallint]

[HKEY_CLASSES_ROOT\Smallint\DefaultIcon]
@="C:\\Program Files\\Smallint\\cluster32.ico,0"
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / Программирование [игнор отключен] [закрыт для гостей] / Помогите автостаротом программы с флешки на Windows 10?
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]