private void SaveUserSettings(string appFileName) { WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); bool hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator); miAddUniversityMember.Enabled = hasAdministrativeRight ? true : false; miRemoveUniversityMember.Enabled = hasAdministrativeRight ? true : false; miAddGroupMember.Enabled = hasAdministrativeRight ? true : false; miRemoveGroupMember.Enabled = hasAdministrativeRight ? true : false; INIManager iniManager = new INIManager(appFileName); iniManager.WritePrivateString("miUniversity", "Enabled", miUniversity.Enabled.ToString()); iniManager.WritePrivateString("miGroup", "Enabled", miGroup.Enabled.ToString()); iniManager.WritePrivateString("miAddUniversityMember", "Enabled", miAddUniversityMember.Enabled.ToString()); iniManager.WritePrivateString("miRemoveUniversityMember", "Enabled", miRemoveUniversityMember.Enabled.ToString()); iniManager.WritePrivateString("miAddGroupMember", "Enabled", miAddGroupMember.Enabled.ToString()); iniManager.WritePrivateString("miRemoveGroupMember", "Enabled", miRemoveGroupMember.Enabled.ToString()); }
public LoginViewModel(IMvxNavigationService navigationService, IRepository repo) { _navigationService = navigationService; _repo = repo; Admin = new Admin(); _iniManager = new INIManager($@"{Directory.GetCurrentDirectory()}\conf\config.ini"); }
public LuaAPI() { //////////////////////////////////////////////////////// /// Interfaces/Classes setter ifs = new INIManager(@"..\setting.ini"); lua = new Lua(); //////////////////////////////////////////////////////// /// CFG setter cfg = ifs.GetString("global", "config"); userdata = ifs.GetString("global", "user"); scripts = ifs.GetString("global", "scripts"); images = ifs.GetString("global", "img"); snd = ifs.GetString("global", "SoundActive"); //////////////////////////////////////////////////////// /// Lua namespace setter lua["IFS"] = new INIManager(); lua["Text"] = ""; lua["ActorName"] = ""; lua["Sound"] = "0"; lua.NewTable("Font"); lua.NewTable("Scene"); lua.NewTable("MainMenu"); lua.RegisterFunction("AddLoaderHook", this, typeof(LuaAPI).GetMethod("SetHook")); }
public void unzip() { try { Process psiw; psiw = Process.Start("cmd", @"/c taskkill /f /im informer.exe"); psiw.Close(); System.Threading.Thread.Sleep(2000); //string startPath = @"D:\YandexDisk\dev.sanekxxx4.ru\c#\launcher_informer\launcher_informer\bin\Debug\"; string zipPath = @"bin.zip"; string extractPath = @"bin\" + GlobalVars.version; //ZipFile.CreateFromDirectory(startPath, zipPath); DirectoryInfo directoryinfo = new DirectoryInfo(extractPath); if (directoryinfo.Exists) { directoryinfo.Delete(true); } ZipFile.ExtractToDirectory(zipPath, extractPath); label1.Text = "Разархивация!"; copy(); string fullPath = Application.StartupPath.ToString(); INIManager manager = new INIManager(fullPath + "\\my.ini"); manager.WritePrivateString("main", "version", GlobalVars.version); Process.Start("informer.exe"); } catch (Exception ex) { LogFile Log = new LogFile("error_launcher"); Log.writeLogLine(ex.Message + " unzip"); } }
public dialprogr_new(string path, neqweqe neqqqqq) { InitializeComponent(); this.neqqqqq = neqqqqq; this.path = path; log.Add("Старт диалога"); INIManager client_man = new INIManager(Environment.CurrentDirectory + @"\ecadpro.ini"); admin = client_man.GetPrivateString("giulianovars", "3dsadmin"); //версия клиента authotiz_root = client_man.GetPrivateString("giulianovars", "attivazione"); //получ ключ активации loadspis(); lb2.Content = "Текущий заказ " + path.Split('\\').Last(); log.Add("Текущий заказ " + path.Split('\\').Last()); if (admin != "1") { admbtn.Visibility = Visibility.Collapsed; mivip.Visibility = Visibility.Collapsed; miarh.Visibility = Visibility.Collapsed; mizagr.Visibility = Visibility.Collapsed; } log.Add("admin " + admin); }
private void button3_Click(object sender, EventArgs e) { if (openFileDialog2.ShowDialog() == DialogResult.Cancel) { return; } // получаем выбранный файл string filename = openFileDialog2.FileName; string filename1 = openFileDialog2.SafeFileName; string dir = Path.GetDirectoryName(openFileDialog2.FileName); //MessageBox.Show(Path.GetDirectoryName(openFileDialog1.FileName)); textBox12.Text = filename; string fullPath = Application.StartupPath.ToString(); INIManager manager = new INIManager(fullPath + "\\my.ini"); manager.WritePrivateString("main", "path2", filename); manager.WritePrivateString("main", "filename2", filename1); manager.WritePrivateString("main", "dir2", dir); GlobalVars.dir2 = dir; GlobalVars.pathreload2 = filename; GlobalVars.filename2 = filename1; //MessageBox.Show(filename+" без "+ filename1); }
public void Save(ref INIManager ifs, string path) { ifs.WritePrivateStringA("param", Idx.ToString() + "sect", Convert.ToString(Section), path); ifs.WritePrivateStringA("param", Idx.ToString() + "sect_string", SectionString, path); ifs.WritePrivateStringA("param", Idx.ToString() + "sect_old", SectionStringOld, path); ifs.WritePrivateStringA("param", Idx.ToString() + "sect_label", Convert.ToString(SectionLabel), path); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { //загрузить // WebClient client = new WebClient(); var url = "ftp://giulianovars.ru/zakaz/for_spis/" + (lb1.SelectedItem as zayavki).files.Split(',').First(); INIManager client_man = new INIManager(Environment.CurrentDirectory + @"\_ecadpro\ecadpro.ini"); string path_sysdba = client_man.GetPrivateString("Infogen", "percorsoordini");//версия клиента string tmppath = Environment.CurrentDirectory + @"\" + path_sysdba + @"\000001.eve"; log.Add("Путь куда установили " + tmppath); // MessageBox.Show(tmppath); // client.DownloadFile(url, tmppath);//скачаем новую // Get the object used to communicate with the server. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(url); request.Method = WebRequestMethods.Ftp.DownloadFile; // This example assumes the FTP site uses anonymous logon. request.Credentials = new NetworkCredential("ecad", "UWnlLh3PLy"); // получаем ответ от сервера в виде объекта FtpWebResponse FtpWebResponse response = (FtpWebResponse)request.GetResponse(); // получаем поток ответа Stream responseStream = response.GetResponseStream(); // сохраняем файл в дисковой системе // создаем поток для сохранения файла FileStream fs = new FileStream(tmppath, FileMode.Create); //Буфер для считываемых данных byte[] buffer = new byte[64]; int size = 0; while ((size = responseStream.Read(buffer, 0, buffer.Length)) > 0) { fs.Write(buffer, 0, size); } fs.Close(); response.Close(); neqqqqq.getParam(neqqqqq.xamb, "carica", tmppath); neqqqqq.getParamI(neqqqqq.Ambiente, "bcarica"); retzakaz = "1"; // MessageBox.Show("Готово, теперь в номере заказа укажите 1"); Close(); }
private static async Task AddClientToBitrix(Bitrix_Clients clients) { INIManager BTX = new INIManager("c:\\config.ini"); string BitrixName = BTX.GetPrivateString("BTX", "logPD"); string BitrixPass = BTX.GetPrivateString("BTX", "pasPD"); string url = "https://" + BitrixName + "/rest/1/" + BitrixPass + "/crm.contact.add.json"; // Serialize our concrete class into a JSON String foreach (Bitrix_Client client in clients.bitrix_Clients) { if (!client.Status) { var stringPayload = await Task.Run(() => JsonConvert.SerializeObject(ClientToBitrixFormat(client))); // Wrap our JSON inside a StringContent which then can be used by the HttpClient class var httpContent = new StringContent(stringPayload, Encoding.UTF8, "application/json"); using (var httpClient = new HttpClient()) { // Do the actual request and await the response var httpResponse = await httpClient.PostAsync(url, httpContent); // If the response contains content we want to read it! if (httpResponse.Content != null) { var responseContent = await httpResponse.Content.ReadAsStringAsync(); Console.WriteLine(responseContent); if (responseContent.Contains("\"result\":")) { client.Status = true; } // From here on you could deserialize the ResponseContent back again to a concrete C# type using Json.Net } } } } List <Bitrix_Client> k = new List <Bitrix_Client>(); int i = 0; foreach (Bitrix_Client cl in clients.bitrix_Clients) { if (clients.bitrix_Clients == null || clients.bitrix_Clients[i].Add_date != DateTime.Today) { k.Add(cl); } i++; } foreach (var n in k) { clients.bitrix_Clients.Remove(n); } WriteToJsonFile <Bitrix_Clients>("clients.json", clients); }
public static void Save() { INIManager.Clear(); INIManager.SetNovelPath(NovelPath); INIManager.SetNovels(NovelList); // TODO SetTranslatorType // TODO }
public static void Main(string[] args) { //对于INIManager的示例 INIManager ini = new INIManager("./config.cfg"); ini["Hello"]["World"] = "233"; Debug.WriteLine(ini["Hello"].GetValue <int>("World") - 1); }
private void button1_Click(object sender, EventArgs e) { if (IsNull(textBox1) || IsNull(textBox2) || IsNull(folderBrowserDialog1.SelectedPath)) { DialogManager.showDialogError("Empty Fields."); return; } INIManager ini = new INIManager(iniName); ini.WritePrivateString("Enter", "ServerName", textBox1.Text); ini.WritePrivateString("Enter", "DataBaseName", textBox2.Text); ini.WritePrivateString("Enter", "Path", folderBrowserDialog1.SelectedPath); if (SQLWorker.IsCreate(textBox1.Text, textBox2.Text)) { sqlWorker = new SQLWorker(textBox1.Text, textBox2.Text); if (checkBox1.Checked) { DataViewPage form1 = new DataViewPage(sqlWorker); form1.Show(); } else { DialogManager.showDialogInfo("Sucsess! You can close window."); } } else { if (DialogManager.showDialogYesNo("Data Base or Server not found. Create new Data Base?")) { if (!creater()) { DialogManager.showDialogError("Error creating database. Try Again."); if (!SQLWorker.delDB(textBox1.Text, textBox2.Text)) { DialogManager.showDialogError("Error cleaning data."); } return; } else { sqlWorker = new SQLWorker(textBox1.Text, textBox2.Text); if (checkBox1.Checked) { DataViewPage form1 = new DataViewPage(sqlWorker); form1.Show(); } else { DialogManager.showDialogInfo("Sucsess! You can close window."); } } } } }
public static void Init() { INIManager = new INIManager(); NovelPath = INIManager.GetNovelPath(); NovelList = INIManager.GetNovels(); TranslatorType = TranslatorType.None; // TODO TranslateWithSource = true; // TODO }
public void Load(ref INIManager ifs, string path, int NewIdx) { Idx = NewIdx; Section = Convert.ToInt32(ifs.GetString(path, "param", Idx.ToString() + "sect")); SectionStringOld = ifs.GetString(path, "param", Idx.ToString() + "sect_old"); SectionString = ifs.GetString(path, "param", Idx.ToString() + "sect_string"); SectionLabel = Convert.ToInt32(ifs.GetString(path, "param", Idx.ToString() + "sect_label")); }
private void Enter_Load(object sender, EventArgs e) { INIManager ini = new INIManager(iniName); textBox1.Text = ini.GetPrivateString("Enter", "ServerName"); textBox2.Text = ini.GetPrivateString("Enter", "DataBaseName"); folderBrowserDialog1.SelectedPath = ini.GetPrivateString("Enter", "Path"); textBox3.Text = folderBrowserDialog1.SelectedPath; }
public SettingsForm() { InitializeComponent(); string fullPath = Application.StartupPath.ToString(); manager = new INIManager(fullPath + "\\my.ini"); _logs = new LogFile("log_settins"); _errors = new LogFile("error_settings"); ini(); }
public DBConnect() { string strPath = System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); INIManager manager = new INIManager(strPath + @"\settings.ini"); host = manager.GetPrivateString("DatabaseConnect", "host"); db = manager.GetPrivateString("DatabaseConnect", "database"); user = manager.GetPrivateString("DatabaseConnect", "user"); password = manager.GetPrivateString("DatabaseConnect", "password"); }
static void Main(string[] args) { INIManager manager = new INIManager("C:\\my.ini"); string name = manager.GetPrivateString("main", "name"); Console.WriteLine(name); manager.WritePrivateString("Василий", "возраст", "21"); }
private static async Task <string> AddCheklistToBitrixTask(string ID, string NAME, string Person) { INIManager BTX = new INIManager("c:\\config.ini"); string BitrixName = BTX.GetPrivateString("BTX", "logPD"); string BitrixPass = BTX.GetPrivateString("BTX", "pasPD"); string task = "task.checklistitem.add"; string url = "https://" + BitrixName + "/rest/32/" + BitrixPass + "/" + task; // Serialize our concrete class into a JSON String var stringPayload = await Task.Run(() => JsonConvert.SerializeObject( new { TASKID = ID, FIELDS = new[] { new{ TITLE = NAME + " " + "@" + Person, SORT_INDEX = 1, IS_COMPLETE = "N" }, new{ TITLE = NAME + "2323 " + "@" + Person, SORT_INDEX = 2, IS_COMPLETE = "Y" }, } } )); var httpContent = new StringContent(stringPayload, Encoding.UTF8, "application/json"); using (var httpClient = new HttpClient()) { // Do the actual request and await the response var httpResponse = await httpClient.PostAsync(url, httpContent); // var httpResponse = await httpClient.GetAsync(url); // If the response contains content we want to read it! if (httpResponse.Content != null) { var responseContent = await httpResponse.Content.ReadAsStringAsync(); WriteLog(responseContent); Console.WriteLine(responseContent); Console.WriteLine(DateTime.Now + " : " + task); ID = responseContent; // From here on you could deserialize the ResponseContent back again to a concrete C# type using Json.Net } } // WriteLog(ID); ID = Regex.Match(Regex.Match(ID, @"""ID"":""\d+").Value, @"\d+").Value; // WriteLog(ID); Console.WriteLine(DateTime.Now + " : " + ID); return(ID); }
void skachatb() { var url = "ftp://giulianovars.ru/zakaz/" + (lb1.SelectedItem as string); INIManager client_man = new INIManager(Environment.CurrentDirectory + @"\_ecadpro\ecadpro.ini"); string path_sysdba = client_man.GetPrivateString("Infogen", "percorsoordini");//версия клиента string tmppath = Environment.CurrentDirectory + @"\" + path_sysdba + @"\000001.eve"; log.Add("Путь куда установили " + tmppath); // MessageBox.Show(tmppath); // client.DownloadFile(url, tmppath);//скачаем новую // Get the object used to communicate with the server. FtpWebRequest request = (FtpWebRequest)WebRequest.Create(url); request.Method = WebRequestMethods.Ftp.DownloadFile; // This example assumes the FTP site uses anonymous logon. request.Credentials = new NetworkCredential("ecad", "UWnlLh3PLy"); FtpWebResponse response = (FtpWebResponse)request.GetResponse(); // получаем поток ответа Stream responseStream = response.GetResponseStream(); // сохраняем файл в дисковой системе // создаем поток для сохранения файла FileStream fs = new FileStream(tmppath, FileMode.Create); //Буфер для считываемых данных byte[] buffer = new byte[64]; int size = 0; while ((size = responseStream.Read(buffer, 0, buffer.Length)) > 0) { fs.Write(buffer, 0, size); } fs.Close(); response.Close(); Console.WriteLine("Загрузка и сохранение файла завершены"); Console.Read(); retzakaz = "1"; neqqqqq.getParam(neqqqqq.xamb, "carica", tmppath); neqqqqq.getParamI(neqqqqq.Ambiente, "bcarica"); Close(); }
protected override void OnLoad(EventArgs e) { base.WindowBorder = WindowBorder.Hidden; base.OnLoad(e); Title = "SageCS - BFME II"; Renderer.shaders.Add("textured", new Shader(Resource.GetShader("tex.vert"), Resource.GetShader("tex.frag"))); Renderer.activeShader = "textured"; try { Texture t = new Texture(); t.Load(File.Open("GermanSplash.jpg", FileMode.Open)); Renderer.textures.Add("splash", t); } catch { Texture t = new Texture(); t.Load(File.Open("EnglishSplash.jpg", FileMode.Open)); Renderer.textures.Add("splash", t); } Sprite background = new Sprite("splash"); Renderer.initProgram(Width, Height); Renderer.render(); base.SwapBuffers(); FileSystem.Init(); AudioSystem.Init(); Stopwatch stopwatch = Stopwatch.StartNew(); Texture tex = new Texture(); var texS = FileSystem.Open("art\\compiledtextures\\al\\all_faction_banners.dds"); tex.Load(texS); W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skn.w3d")); W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_runa.w3d")); W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skl.w3d")); INIManager.ParseINIs(); var buffer = WavLoader.Load(FileSystem.Open("data\\audio\\speech\\ucheer.wav")); Audio.Sound testSound = new Audio.Sound(buffer); testSound.Play(); stopwatch.Stop(); Console.WriteLine("total loading time: " + stopwatch.ElapsedMilliseconds + "ms"); }
private void LoadUserSettings(string appFileName) { INIManager iniManager = new INIManager(appFileName); miAddUniversityMember.Enabled = bool.Parse(iniManager. GetPrivateString("miAddUniversityMember", "Enabled")); miRemoveUniversityMember.Enabled = bool.Parse(iniManager. GetPrivateString("miRemoveUniversityMember", "Enabled")); miAddGroupMember.Enabled = bool.Parse(iniManager. GetPrivateString("miAddGroupMember", "Enabled")); miRemoveGroupMember.Enabled = bool.Parse(iniManager. GetPrivateString("miRemoveGroupMember", "Enabled")); }
public static void Init() { INIManager BTX = new INIManager("c:\\config.ini"); BitrixName = BTX.GetPrivateString("BTX", "logPD"); BitrixPass = BTX.GetPrivateString("BTX", "pasPD"); DepSale = BTX.GetPrivateString("BTX", "DepSale"); DepFas = BTX.GetPrivateString("BTX", "DepFas"); DepStone = BTX.GetPrivateString("BTX", "DepStone"); StaffSale = BTX.GetPrivateString("BTX", "StaffSale"); StaffFas = BTX.GetPrivateString("BTX", "StaffFas"); StaffStone = BTX.GetPrivateString("BTX", "StaffStone"); Direct1 = BTX.GetPrivateString("BTX", "Direct1"); Direct2 = BTX.GetPrivateString("BTX", "Direct2"); Direct3 = BTX.GetPrivateString("BTX", "Direct3"); }
private void checkBox8_CheckedChanged(object sender, EventArgs e) { if (checkBox8.Checked) { string fullPath = Application.StartupPath.ToString(); INIManager manager = new INIManager(fullPath + "\\my.ini"); manager.WritePrivateString("main", "internet_r", "1"); GlobalVars.internet_r = "1"; } else { string fullPath = Application.StartupPath.ToString(); INIManager manager = new INIManager(fullPath + "\\my.ini"); manager.WritePrivateString("main", "internet_r", "0"); GlobalVars.internet_r = "0"; } }
public kommunikacii_main(string pathBD) { InitializeComponent(); log.Add("старт диалог моделей"); lb4.Visibility = Visibility.Collapsed; lb1.Visibility = Visibility.Collapsed; // stpan.Visibility = Visibility.Collapsed; //btnserv.Visibility = Visibility.Collapsed; dir3ds = Environment.CurrentDirectory + @"\3dsObject\Web"; dir3ds_user = Environment.CurrentDirectory + @"\3dsObject\User"; Directory.CreateDirectory(dir3ds); Directory.CreateDirectory(dir3ds_user); this.pathBD = pathBD; BD.path = pathBD; //укажем файл бд INIManager client_man = new INIManager(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\ecadpro.ini"); admin = client_man.GetPrivateString("Infogen", "3dsadmin");//версия клиента if (admin == "1") { label1.Visibility = Visibility.Visible; allnaserver.Visibility = Visibility.Visible; } else { lb4.ContextMenu = null; label1.Visibility = Visibility.Collapsed; allnaserver.Visibility = Visibility.Collapsed; } move_to_new_41(); loadpage(); log.Add("lb3napolnene"); lb3napolnene(); lb2napolnene(); }
private void Button_Click(object sender, RoutedEventArgs e) { INIManager manager = new INIManager(Environment.CurrentDirectory + @"\ecadpro.ini"); string authotiz_root = manager.GetPrivateString("giulianovars", "attivazione");//получ ключ активации //отрпавка самого фала // FileStream fileStream = File.OpenRead(path); // pb1.Minimum = 0; // pb1.Maximum = (fileStream.Length) / 1024; // pb1.Value = 0; btnStart.IsEnabled = false; // pb1.Value = result; string massivfiles = ""; string pref = authotiz_root + "_" + nomzakaza + "_"; massivfiles += pref + nomzakaza + ".eve" + ","; FTPupload(path, pref + nomzakaza + ".eve"); //1 закачиваем сам заказ foreach (spisfiles elem in tb_dop.Items) { massivfiles += pref + elem.name + ","; FTPupload(elem.path, pref + elem.name); //1 закачиваем сам заказ } massivfiles = massivfiles.Trim(','); WebClient client = new WebClient(); var url = "http://ecad.giulianovars.ru/php/upload_progr/load_spis.php?command=2"; client.Headers["Content-Type"] = "application/x-www-form-urlencoded"; client.Encoding = Encoding.UTF8; var response = client.UploadString(url, "POST", "text=" + rb1.Text + "&files=" + massivfiles + "&authotiz_root=" + authotiz_root + "&zakaz=" + nomzakaza); MessageBox.Show("Заказ успешно отправлен"); Close(); }
protected override void OnLoad(EventArgs e) { base.WindowBorder = WindowBorder.Hidden; base.OnLoad(e); GraphicsSystem.Init(); Title = "SageCS - BFME II"; try { Texture t = new Texture(); t.Load(File.Open("GermanSplash.jpg", FileMode.Open)); Sprite sp = new Sprite(Vector2.Zero, new Vector2(800, 600), t); sp.Draw(GraphicsSystem.GetScreen()); } catch { Texture t = new Texture(); t.Load(File.Open("EnglishSplash.jpg", FileMode.Open)); } base.SwapBuffers(); FileSystem.Init(); AudioSystem.Init(); Stopwatch stopwatch = Stopwatch.StartNew(); Texture tex = new Texture(); var texS = FileSystem.Open("art\\compiledtextures\\al\\all_faction_banners.dds"); tex.Load(texS); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skn.w3d")); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_runa.w3d")); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skl.w3d")); INIManager.ParseINIs(); var buffer = WavLoader.Load(FileSystem.Open("data\\audio\\speech\\ucheer.wav")); Sound testSound = new Sound(buffer); testSound.Play(); stopwatch.Stop(); Console.WriteLine("total loading time: " + stopwatch.ElapsedMilliseconds + "ms"); }
public void update() { try { string fullPath = Application.StartupPath.ToString(); INIManager manager = new INIManager(fullPath + "\\my.ini"); string v = manager.GetPrivateString("main", "version"); string pack = new WebClient().DownloadString("http://allminer.ru/api/?method=version"); Movie m = JsonConvert.DeserializeObject <Movie>(pack); string ver = m.version; GlobalVars.version = m.version; GlobalVars.link = m.source; if (v == ver) { //MessageBox.Show("У Вас старая версия"); label1.Text = "У Вас актуальная версия"; Process psiw; psiw = Process.Start("cmd", @"/c taskkill /f /im informer.exe"); psiw.Close(); System.Threading.Thread.Sleep(2000); Process.Start("informer.exe"); } else { label1.Text = "Вышла новая версия! Обновление!"; //MessageBox.Show("Новая версия!!!" + v + " " + ver); Process psiw; psiw = Process.Start("cmd", @"/c taskkill /f /im informer.exe"); psiw.Close(); download(GlobalVars.link); } } catch (Exception ex) { LogFile Log = new LogFile("error_launcher"); Log.writeLogLine(ex.Message + " fun update"); } }
public ArrayList GetInfoportionsFiles() { ArrayList res = new ArrayList(); if (File.Exists(Folder_game + SYSTEM_FILE)) { //Создание объекта, для работы с файлом INIManager IniManager = new INIManager(Folder_game + SYSTEM_FILE); //Получить значение string files = IniManager.GetPrivateString("info_portions", "files"); string[] buff = files.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string str in buff) { res.Add(str.Trim() + ".xml"); } } else { throw new Exception($"Отсутствует файл {SYSTEM_FILE}"); } return(res); }
/// <summary> /// Получаем список файлов локализации /// </summary> /// <returns>Массив строк с файлами локализации</returns> public ArrayList GetStringTableFiles() { ArrayList arrDialogFiles = new ArrayList(); if (File.Exists(Folder_game + LOCALIZATION_FILE)) { //Создание объекта, для работы с файлом INIManager IniManager = new INIManager(Folder_game + LOCALIZATION_FILE); //Получить значение string files = IniManager.GetPrivateString("string_table", "files"); string[] buff = files.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string str in buff) { arrDialogFiles.Add(str.Trim() + ".xml"); } } else { throw new Exception($"Отсутствует файл {LOCALIZATION_FILE}"); } return(arrDialogFiles); }