14
14
using HslCommunication . BasicFramework ;
15
15
16
16
17
- //============================================================================
18
- // 模版日期 2017-02-21
19
- // 创建人 胡少林
20
- // 版权所有 胡少林
21
- // 授权说明 模版仅授权个人使用,如需商用,请联系hsl200909@163.com洽谈
22
- // 说明 JSON组件引用自james newton-king,遵循MIT授权协议
23
- // 说明 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享
24
- //============================================================================
17
+ /***************************************************************************************
18
+ *
19
+ * 模版日期 2017-05-20
20
+ * 创建人 胡少林
21
+ * 版权所有 胡少林
22
+ * 授权说明 模版仅授权个人使用,如需商用,请联系hsl200909@163.com洽谈
23
+ * 说明一 JSON组件引用自james newton-king,遵循MIT授权协议
24
+ * 说明二 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享
25
+ *
26
+ ****************************************************************************************/
25
27
28
+ /***************************************************************************************
29
+ *
30
+ * 版本说明 最新版以github为准,由于提交更改比较频繁,需要经常查看官网地址:https://github.com/dathlin/C-S-
31
+ * 注意 本代码的相关操作未作密码验证,如有需要,请自行完成
32
+ * 示例 密码验证具体示例参照Form1_FormClosing(object sender, FormClosingEventArgs e)方法
33
+ * 如果 遇到启动调试就退出了,请注释掉Program.cs文件中的指允许启动一个实例的代码
34
+ *
35
+ ****************************************************************************************/
26
36
27
- //============================================================================
28
- //
29
- // 注意:本代码的相关操作未作密码验证,如有需要,请自行完成
30
- // 示例:具体示例参照Form1_FormClosing(object sender, FormClosingEventArgs e)方法
31
- // 如果:遇到启动调试就退出了,请注释掉Program.cs文件中的指允许启动一个实例的代码
32
- //
33
- //============================================================================
34
37
35
38
36
39
@@ -125,22 +128,28 @@ private void FormMainWindow_FormClosing(object sender, FormClosingEventArgs e)
125
128
private void 修改密码ToolStripMenuItem_Click ( object sender , EventArgs e )
126
129
{
127
130
//实例化一个密码修改的窗口,并指定了实现修改的具体方法,指定了密码长度
128
- FormPasswordModify fpm = new FormPasswordModify ( UserClient . UserAccount . Password ,
129
- p => {
130
- JObject json = new JObject ( ) ; json . Add ( UserAccount . UserNameText , UserClient . UserAccount . UserName ) ;
131
- json . Add ( UserAccount . PasswordText , p ) ;
131
+ using ( FormPasswordModify fpm = new FormPasswordModify ( UserClient . UserAccount . Password ,
132
+ p =>
133
+ {
134
+ JObject json = new JObject
135
+ {
136
+ { UserAccount . UserNameText , UserClient . UserAccount . UserName } ,
137
+ { UserAccount . PasswordText , p }
138
+ } ;
132
139
return UserClient . Net_simplify_client . ReadFromServer ( CommonHeadCode . SimplifyHeadCode . 密码修改 + json . ToString ( ) ) . IsSuccess ;
133
- } , 6 , 8 ) ;
134
- fpm . ShowDialog ( ) ;
135
- fpm . Dispose ( ) ;
140
+ } , 6 , 8 ) )
141
+ {
142
+ fpm . ShowDialog ( ) ;
143
+ }
136
144
}
137
145
138
146
private void 关于本软件ToolStripMenuItem_Click ( object sender , EventArgs e )
139
147
{
140
- FormAbout fa = new FormAbout ( Resource . StringResouce . SoftName ,
141
- UserClient . CurrentVersion , 2017 , Resource . StringResouce . SoftCopyRight ) ;
142
- fa . ShowDialog ( ) ;
143
- fa . Dispose ( ) ;
148
+ using ( FormAbout fa = new FormAbout ( Resource . StringResouce . SoftName ,
149
+ UserClient . CurrentVersion , 2017 , Resource . StringResouce . SoftCopyRight ) )
150
+ {
151
+ fa . ShowDialog ( ) ;
152
+ }
144
153
}
145
154
146
155
private void 更新日志ToolStripMenuItem_Click ( object sender , EventArgs e )
@@ -151,31 +160,35 @@ private void 更新日志ToolStripMenuItem_Click(object sender, EventArgs e)
151
160
UserClient . JsonSettings . IsNewVersionRunning = false ;
152
161
UserClient . JsonSettings . SaveToFile ( ) ;
153
162
}
154
- FormUpdateLog ful = new FormUpdateLog ( UserClient . HistoryVersions ) ;
155
- ful . ShowDialog ( ) ;
156
- ful . Dispose ( ) ;
163
+ using ( FormUpdateLog ful = new FormUpdateLog ( UserClient . HistoryVersions ) )
164
+ {
165
+ ful . ShowDialog ( ) ;
166
+ }
157
167
}
158
168
159
169
private void 版本号说明ToolStripMenuItem_Click ( object sender , EventArgs e )
160
170
{
161
- FormAboutVersion fav = new FormAboutVersion ( UserClient . CurrentVersion ) ;
162
- fav . ShowDialog ( ) ;
163
- fav . Dispose ( ) ;
171
+ using ( FormAboutVersion fav = new FormAboutVersion ( UserClient . CurrentVersion ) )
172
+ {
173
+ fav . ShowDialog ( ) ;
174
+ }
164
175
}
165
176
166
177
private void 更改公告ToolStripMenuItem_Click ( object sender , EventArgs e )
167
178
{
168
- FormInputAndAction fiaa = new FormInputAndAction ( str => UserClient . Net_simplify_client . ReadFromServer (
169
- CommonHeadCode . SimplifyHeadCode . 更新公告 + str ) . IsSuccess , UserClient . Announcement ) ;
170
- fiaa . ShowDialog ( ) ;
171
- fiaa . Dispose ( ) ;
179
+ using ( FormInputAndAction fiaa = new FormInputAndAction ( str => UserClient . Net_simplify_client . ReadFromServer (
180
+ CommonHeadCode . SimplifyHeadCode . 更新公告 + str ) . IsSuccess , UserClient . Announcement ) )
181
+ {
182
+ fiaa . ShowDialog ( ) ;
183
+ }
172
184
}
173
185
174
186
private void 日志查看ToolStripMenuItem_Click ( object sender , EventArgs e )
175
187
{
176
- FormLog flg = new FormLog ( ) ;
177
- flg . ShowDialog ( ) ;
178
- flg . Dispose ( ) ;
188
+ using ( FormLog flg = new FormLog ( ) )
189
+ {
190
+ flg . ShowDialog ( ) ;
191
+ }
179
192
}
180
193
181
194
private void 注册账号ToolStripMenuItem_Click ( object sender , EventArgs e )
0 commit comments