123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using AGV_WPF.TrafficDefine;
- using AGV_WPF_Global;
- using System.Collections;
- using AGV_WPF.Models;
- using System.Collections.ObjectModel;
- using System.Configuration;
- using System.IO;
- using System.Diagnostics;
- namespace AGV_WPF
- {
- /// <summary>
- /// TrafficWindow.xaml 的交互逻辑
- /// </summary>
- public partial class TestTrafficWindow : Window
- {
- public TestTrafficWindow()
- {
- InitializeComponent();
-
- }
- public static bool SetIndexConfigValue(string key, string value)
- {
- string startPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
- string pluginPath = System.IO.Path.Combine(startPath, "plugins");
- string pluginPath1 = System.IO.Path.Combine(pluginPath, "UseRate.dll.config");
- if (!Directory.Exists(pluginPath))
- {
- Directory.CreateDirectory(pluginPath);
- }
- if (!File.Exists(pluginPath1))
- throw new Exception(string.Format("配置文件不存在:{0}", pluginPath));
- ExeConfigurationFileMap ecf = new ExeConfigurationFileMap();
- ecf.ExeConfigFilename = pluginPath1;
- Configuration config = ConfigurationManager.OpenMappedExeConfiguration(ecf, ConfigurationUserLevel.None);
- config.AppSettings.Settings[key].Value = value;
- config.Save();
- return true;
- }
- private void btnAgvData_Click(object sender, RoutedEventArgs e)
- {
-
- }
- private void btnClear_Click(object sender, RoutedEventArgs e)
- {
-
- }
- }
- }
|