-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
157 lines (150 loc) · 6.11 KB
/
Form1.cs
File metadata and controls
157 lines (150 loc) · 6.11 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PS多语言启动器
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/*
private string OpenSubKey(RegistryKey key, string name, string value)
{
try
{
return key.OpenSubKey(name).GetValue(value).ToString();
}
catch (Exception e)
{
return null;
}
}
*/
private void label1_Click(object sender, EventArgs e)
{
Process.Start("https://www.muruoxi.com/");
}
private void button1_Click(object sender, EventArgs e)
{
/*Dictionary<string, string> ps = new Dictionary<string, string>();
ps.Add("cs6", OpenSubKey(photoshop, "60.0", "ApplicationPath"));
for (int i = 13,j = 7;i<=20 ;i++,j++)
{
ps.Add("cc"+i.ToString(), OpenSubKey(photoshop, j.ToString()+"0.0", "ApplicationPath"));
}*/
try
{
string path = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Adobe\Photoshop\120.0").GetValue("ApplicationPath").ToString();
string cn = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat";
string en = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat.bak";
FileInfo file = new FileInfo(en);
if (file.Exists)
{
file.MoveTo(cn);
}
if (File.Exists(cn))
{
Process process = new Process();
ProcessStartInfo processStartInfo = new ProcessStartInfo(path + "Photoshop.exe");
process.StartInfo = processStartInfo;
if (!process.Start())
{
MessageBox.Show("启动失败,你的PS是正常安装的吗?");
}
else
{
ShowInTaskbar = false;
Hide();
Task.Delay(60 * 1000);
File.Move(cn, en);
Close();
}
}
else
{
MessageBox.Show("您用的是精简版的PS???");
}
}
catch
{
MessageBox.Show("Adobe PhotoShop CC 2018 产品未被正确安装!");
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
string path = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Adobe\Photoshop\120.0").GetValue("ApplicationPath").ToString();
string cn = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat";
string en = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat.bak";
FileInfo file = new FileInfo(cn);
if (file.Exists)
{
file.MoveTo(en);
}
if (File.Exists(en))
{
Process process = new Process();
ProcessStartInfo processStartInfo = new ProcessStartInfo(path + "Photoshop.exe");
process.StartInfo = processStartInfo;
if (!process.Start())
{
MessageBox.Show("启动失败,你的PS是正常安装的吗?");
}
else
{
ShowInTaskbar = false;
Hide();
Task.Delay(60 * 1000);
File.Move(en, cn);
Close();
}
}
else
{
MessageBox.Show("您用的是精简版的PS???");
}
}
catch
{
MessageBox.Show("Adobe PhotoShop CC 2018 产品未被正确安装!");
}
}
private void button3_Click(object sender, EventArgs e)
{
string path = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Adobe\Photoshop\120.0").GetValue("ApplicationPath").ToString();
string cn = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat";
string en = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat.bak";
if (File.Exists(en))
{
File.Move(en, cn);
}
MessageBox.Show("设置成功!");
Close();
}
private void button4_Click(object sender, EventArgs e)
{
string path = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Adobe\Photoshop\120.0").GetValue("ApplicationPath").ToString();
string cn = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat";
string en = path + @"Locales\zh_CN\Support Files\tw10428_Photoshop_zh_CN.dat.bak";
if (File.Exists(cn))
{
File.Move(cn, en);
}
MessageBox.Show("设置成功!");
Close();
}
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
Close();
}
}
}
}