当前位置: 首页 > news >正文

珠海网站建设排名国产比较好的精华

珠海网站建设排名,国产比较好的精华,wordpress怎么做404页面跳转,写作网站可保存发现网上一键切换JDK环境的方法都是在mac或Linux下的#xff0c;本人主力电脑是Windows#xff0c;于是看了一下WPF的文档#xff0c;自己开发了一个客户端。 直接上代码吧#xff1a; using JavaSwitch.Properties; using Newtonsoft.Json; using System; using System.…发现网上一键切换JDK环境的方法都是在mac或Linux下的本人主力电脑是Windows于是看了一下WPF的文档自己开发了一个客户端。 直接上代码吧 using JavaSwitch.Properties; using Newtonsoft.Json; using System; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Windows; using System.Windows.Forms;namespace JavaSwitch {public class ListItem{public string Text { get; set; }public bool IsSelected { get; set; }public ListItem(string text){Text text;}}/// summary/// MainWindow.xaml 的交互逻辑/// /summarypublic partial class MainWindow : Window{public ObservableCollectionListItem Items { get; set; }public MainWindow(){InitializeComponent();// 从本地加载已有的数据LoadDataFromJson();// 数据绑定上下文DataContext this;}private void Button_Add(object sender, RoutedEventArgs e){FolderBrowserDialog folderBrowserDialog new FolderBrowserDialog{// 设置初始目录RootFolder Environment.SpecialFolder.Desktop};// 这个方法可以显示文件夹选择对话框folderBrowserDialog.ShowDialog();// 获取选择的文件夹的全路径名string directoryPath folderBrowserDialog.SelectedPath;// 打印出选择的路径Console.WriteLine(directoryPath);if (string.IsNullOrEmpty(directoryPath)){return;}// 持久化到本地var newItem new ListItem(directoryPath);Items.Add(newItem);SaveDataToJson();}/// summary/// 删除一项/// /summaryprivate void Button_Delete(object sender, RoutedEventArgs e){var deleteButton sender as System.Windows.Controls.Button;if (deleteButton ! null){var listItem deleteButton.DataContext as ListItem;if (listItem ! null){Items.Remove(listItem);SaveDataToJson();}}}private void Button_Click_1(object sender, RoutedEventArgs e){// 打开环境变量设置页面 rundll32 sysdm.cpl,EditEnvironmentVariablesProcess.Start(rundll32.exe, sysdm.cpl,EditEnvironmentVariables);//string originalPath Environment.GetEnvironmentVariable(PATH, EnvironmentVariableTarget.Machine);//System.Windows.MessageBox.Show(Original Path: originalPath);}private void RadioButton_Click(object sender, RoutedEventArgs e){var radioButton sender as System.Windows.Controls.RadioButton;if (radioButton ! null){var listItem radioButton.DataContext as ListItem;if (listItem ! null){foreach (var item in Items){item.IsSelected item listItem;if (item.IsSelected){// 设置环境变量// 执行bash命令setx JAVA_PATH %JAVA_HOME%\bin;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; /MProcess.Start(cmd, /c setx JAVA_PATH \ item.Text \\bin; item.Text \\lib\\dt.jar; item.Text \\lib\\tools.jar;\ /M);// 执行bash命令refreshenv.cmdProcess.Start(cmd, /c refreshenv.cmd);}}}}SaveDataToJson();}private string ENV_DATA JavaEnvironment.json;/// summary/// 保存数据到本地/// /summaryprivate void SaveDataToJson(){var json JsonConvert.SerializeObject(Items, Formatting.Indented);File.WriteAllText(ENV_DATA, json);}/// summary/// 从本地加载数据/// /summaryprivate void LoadDataFromJson(){if (File.Exists(ENV_DATA)){var json File.ReadAllText(ENV_DATA);Items JsonConvert.DeserializeObjectObservableCollectionListItem(json);}else{Items new ObservableCollectionListItem();}}} } 布局文件 Window x:ClassJavaSwitch.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:JavaSwitchmc:IgnorabledTitleJava环境切换 Height450 Width800GridTextBlock FontSize18 FontWeightBold Foreground#ffbe4d4d HorizontalAlignmentLeft Margin10,10,0,0 TextWrappingWrap Text请用管理员身份打开本程序否则没有权限修改设置 VerticalAlignmentTop Width586/TextBlock FontSize16 HorizontalAlignmentLeft Margin10,47,0,0 TextWrappingWrap Text第一步打开系统变量-Path检查并添加%JAVA_PATH%已添加则不用重复添加 VerticalAlignmentTop Width629/TextBlock FontSize16 HorizontalAlignmentLeft Margin10,84,0,0 TextWrappingWrap Text第二步添加已安装的JDK文件夹 VerticalAlignmentTop Width263/Button FontSize16 Content检查环境变量 HorizontalAlignmentLeft Margin639,47,0,0 VerticalAlignmentTop ClickButton_Click_1/Button FontSize16 Content添加一个Java环境 HorizontalAlignmentLeft Margin257,82,0,0 VerticalAlignmentTop ClickButton_Add/TextBlock FontSize16 HorizontalAlignmentLeft Margin10,123,0,0 TextWrappingWrap Text第三步点击按钮切换环境 VerticalAlignmentTop/ListBox x:NamelistBox ItemsSource{Binding Items} Margin0,156,0,0ListBox.ItemTemplateDataTemplateStackPanel OrientationHorizontal Margin0, 10, 0, 10Viewbox Height22 VerticalAlignmentCenterRadioButton x:NameradioButton GroupNameRadioGroup IsChecked{Binding IsSelected, ModeTwoWay} ClickRadioButton_Click //ViewboxTextBlock Text{Binding Text} VerticalAlignmentCenter FontSize16 Margin10,0,0,0/Button Content删除 VerticalAlignmentCenter ClickButton_Delete FontSize16 Margin20,0,0,0//StackPanel/DataTemplate/ListBox.ItemTemplate/ListBox/Grid /Window github链接https://github.com/ITAnt/JavaSwitch 安装文件在根目录的release文件夹
http://www.pierceye.com/news/802371/

相关文章:

  • 公司网站制作投标建站行业都扁平化设计
  • 男女做a视频网站wordpress询价功能
  • 网站建设视频百度网盘下载我做网站价格
  • 江苏省建设集团有限公司网站首页东莞网络推广外包
  • 梁平网站建设莱芜网络营销
  • 自学网站建设需要什么学历学校网站建设总结报告
  • 增城新塘网站建设平面设计技术培训机构
  • 游戏网站开发视频运动品牌网页设计
  • 成都比较好的网站建设公司做视频后期的网站
  • 重庆网页搜索排名提升专业seo优化推广
  • 手机免费代理ip网站模板网站的优势有哪些
  • dede地方门户网站模板做网站备案
  • 域名访问网站的知识站酷网官网进入
  • 6入空间网站免费观看wordpress转盘抽奖源码
  • 手机网站怎么开发工具网站开发中如何实现gps定位
  • sql2008做网站焦作网站建设哪家便宜
  • hao123网站源码制作2015最新仿制作链接怎么做
  • 做网站源代码需要买吗做任务得佣金的网站
  • 网站开发php还是jsp中式风格装修效果图
  • 外贸网站建设优化营销昆明网站建设加q.479185700
  • 正安网站建设推荐友情链接
  • 织梦仿asp网站石家庄市制作网站公司
  • 全国较好的网站建设公司织梦网做网站步骤
  • dedecms小说网站模板自动生成网站地图的工具
  • 中国比较好的设计网站php网站怎么做静态化
  • Dedecms手机网站源码wordpress小程序制作
  • 成都网站建设备案重庆找网站推广
  • 商务网站建设的调研wordpress 视频 全屏
  • 网站策划案例广州高端网站定制开发价格
  • 大连网站制作优选ls15227微信公众号小程序搭建