Commit 1ec84764 authored by 黄树航's avatar 黄树航

整理代码

parent 92a69bdc
using System; using System.Windows;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
namespace Dqkj.Setup namespace Dqkj.Setup
{ {
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application public partial class App : Application
{ {
public App() public App()
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Dqkj.Setup.Common namespace Dqkj.Setup.Common
{ {
...@@ -38,7 +35,7 @@ namespace Dqkj.Setup.Common ...@@ -38,7 +35,7 @@ namespace Dqkj.Setup.Common
} }
public static void DeleteTemp(List<string> lisDelete) public static void DeleteTemp(List<string> lisDelete)
{ {
foreach (var ss in lisDelete) foreach (var ss in lisDelete)
{ {
......
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
...@@ -14,7 +12,7 @@ namespace Dqkj.Setup ...@@ -14,7 +12,7 @@ namespace Dqkj.Setup
static string key = "GZCZKJABCDEFG001"; static string key = "GZCZKJABCDEFG001";
public static string DesEncrypt(string normalTxt) public static string DesEncrypt(string normalTxt)
{ {
return des.DesEncrypt(normalTxt, key); return des.DesEncrypt(normalTxt, key);
} }
......
using System; using System.Diagnostics;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Dqkj.Setup.Common namespace Dqkj.Setup.Common
{ {
......
using Microsoft.Win32; using Microsoft.Win32;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Dqkj.Setup.Common namespace Dqkj.Setup.Common
{ {
......
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
namespace Dqkj.Setup namespace Dqkj.Setup
...@@ -32,7 +30,7 @@ namespace Dqkj.Setup ...@@ -32,7 +30,7 @@ namespace Dqkj.Setup
FileStream file = new FileStream(fileName, FileMode.Open); FileStream file = new FileStream(fileName, FileMode.Open);
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] retVal = md5.ComputeHash(file); byte[] retVal = md5.ComputeHash(file);
file.Close(); file.Close();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < retVal.Length; i++) for (int i = 0; i < retVal.Length; i++)
{ {
......
using System; using System.IO;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace Dqkj.Setup namespace Dqkj.Setup
......
using System; using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Dqkj.Setup namespace Dqkj.Setup
{ {
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
public MainWindow() public MainWindow()
...@@ -37,7 +22,7 @@ namespace Dqkj.Setup ...@@ -37,7 +22,7 @@ namespace Dqkj.Setup
private void Window_Loaded(object sender, RoutedEventArgs e) private void Window_Loaded(object sender, RoutedEventArgs e)
{ {
this.mian_content.Content=new InstallView(this); this.mian_content.Content = new InstallView(this);
} }
} }
} }
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Dqkj.Setup namespace Dqkj.Setup
{ {
......
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Dqkj.Setup namespace Dqkj.Setup
{ {
...@@ -17,6 +14,6 @@ namespace Dqkj.Setup ...@@ -17,6 +14,6 @@ namespace Dqkj.Setup
{ {
return System.Version.Parse(this.Version); return System.Version.Parse(this.Version);
} }
} }
} }
} }
using System; using System.Diagnostics;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; 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.Navigation;
using System.Windows.Shapes;
namespace Dqkj.Setup.View namespace Dqkj.Setup.View
{ {
......
using Microsoft.Win32; using System;
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; 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;
namespace Dqkj.Setup namespace Dqkj.Setup
{ {
...@@ -61,7 +50,7 @@ namespace Dqkj.Setup ...@@ -61,7 +50,7 @@ namespace Dqkj.Setup
} }
if (!Directory.Exists(txtPath.Text)) if (!Directory.Exists(txtPath.Text))
{ {
MessageBox.Show("选择的路径不存在!","温馨提示"); MessageBox.Show("选择的路径不存在!", "温馨提示");
return; return;
} }
_mainWindow.mian_content.Content = new ProgressView(txtPath.Text, _mainWindow); _mainWindow.mian_content.Content = new ProgressView(txtPath.Text, _mainWindow);
......
...@@ -5,23 +5,13 @@ using Dqkj.Setup.Common; ...@@ -5,23 +5,13 @@ using Dqkj.Setup.Common;
using Dqkj.Setup.View; using Dqkj.Setup.View;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Linq;
using System.Net; using System.Net;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Path = System.IO.Path; using Path = System.IO.Path;
namespace Dqkj.Setup namespace Dqkj.Setup
...@@ -74,12 +64,12 @@ namespace Dqkj.Setup ...@@ -74,12 +64,12 @@ namespace Dqkj.Setup
public async void Download() public async void Download()
{ {
var serverVersion = await GetUpdateInfo(); var serverVersion = await GetUpdateInfo();
if (serverVersion == null) { throw new Exception("获取安装配置异常!"); } if (serverVersion == null) { throw new Exception("获取安装配置异常!"); }
if (ProcessHelper.CheckProcess(executeName.Replace(".exe", ""))) if (ProcessHelper.CheckProcess(executeName.Replace(".exe", "")))
{ {
var reply = System.Windows.MessageBox.Show("程序正在运行,是否自动关闭程序并开始更新升级", formTitle,MessageBoxButton.YesNo,MessageBoxImage.Information); var reply = System.Windows.MessageBox.Show("程序正在运行,是否自动关闭程序并开始更新升级", formTitle, MessageBoxButton.YesNo, MessageBoxImage.Information);
if (reply != MessageBoxResult.Yes) if (reply != MessageBoxResult.Yes)
{ {
return; return;
...@@ -104,7 +94,7 @@ namespace Dqkj.Setup ...@@ -104,7 +94,7 @@ namespace Dqkj.Setup
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void Client_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) private void Client_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{ {
try try
{ {
...@@ -140,7 +130,7 @@ namespace Dqkj.Setup ...@@ -140,7 +130,7 @@ namespace Dqkj.Setup
} }
finally finally
{ {
DirectoryHelper.DeleteTemp(new List<string>{ zip_temp, _installPath + "_" }); DirectoryHelper.DeleteTemp(new List<string> { zip_temp, _installPath + "_" });
} }
} }
...@@ -159,7 +149,7 @@ namespace Dqkj.Setup ...@@ -159,7 +149,7 @@ namespace Dqkj.Setup
{ {
WebClient client = new WebClient(); WebClient client = new WebClient();
client.Encoding = Encoding.UTF8; client.Encoding = Encoding.UTF8;
var serverXml =await client.DownloadStringTaskAsync(new Uri(defaultUpdateXmlUrl)); var serverXml = await client.DownloadStringTaskAsync(new Uri(defaultUpdateXmlUrl));
if (!string.IsNullOrEmpty(serverXml)) if (!string.IsNullOrEmpty(serverXml))
{ {
info = XmlHelper.Deserialize<UpdateInfo>(serverXml); info = XmlHelper.Deserialize<UpdateInfo>(serverXml);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment