1414using HslCommunication . BasicFramework ;
1515
1616
17- //============================================================================
18- // 模版日期 2017-02-21
19- // 创建人 胡少林
20- // 版权所有 胡少林
21- // 授权说明 模版仅授权个人使用,如需商用,请联系[email protected] 洽谈 22- // 说明 JSON组件引用自james newton-king,遵循MIT授权协议
23- // 说明 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享
24- //============================================================================
17+ /***************************************************************************************
18+ *
19+ * 模版日期 2017-05-20
20+ * 创建人 胡少林
21+ * 版权所有 胡少林
22+ * 授权说明 模版仅授权个人使用,如需商用,请联系[email protected] 洽谈 23+ * 说明一 JSON组件引用自james newton-king,遵循MIT授权协议
24+ * 说明二 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享
25+ *
26+ ****************************************************************************************/
2527
28+ /***************************************************************************************
29+ *
30+ * 版本说明 最新版以github为准,由于提交更改比较频繁,需要经常查看官网地址:https://github.com/dathlin/C-S-
31+ * 注意 本代码的相关操作未作密码验证,如有需要,请自行完成
32+ * 示例 密码验证具体示例参照Form1_FormClosing(object sender, FormClosingEventArgs e)方法
33+ * 如果 遇到启动调试就退出了,请注释掉Program.cs文件中的指允许启动一个实例的代码
34+ *
35+ ****************************************************************************************/
2636
27- //============================================================================
28- //
29- // 注意:本代码的相关操作未作密码验证,如有需要,请自行完成
30- // 示例:具体示例参照Form1_FormClosing(object sender, FormClosingEventArgs e)方法
31- // 如果:遇到启动调试就退出了,请注释掉Program.cs文件中的指允许启动一个实例的代码
32- //
33- //============================================================================
3437
3538
3639
@@ -125,22 +128,28 @@ private void FormMainWindow_FormClosing(object sender, FormClosingEventArgs e)
125128 private void 修改密码ToolStripMenuItem_Click ( object sender , EventArgs e )
126129 {
127130 //实例化一个密码修改的窗口,并指定了实现修改的具体方法,指定了密码长度
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+ } ;
132139 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+ }
136144 }
137145
138146 private void 关于本软件ToolStripMenuItem_Click ( object sender , EventArgs e )
139147 {
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+ }
144153 }
145154
146155 private void 更新日志ToolStripMenuItem_Click ( object sender , EventArgs e )
@@ -151,31 +160,35 @@ private void 更新日志ToolStripMenuItem_Click(object sender, EventArgs e)
151160 UserClient . JsonSettings . IsNewVersionRunning = false ;
152161 UserClient . JsonSettings . SaveToFile ( ) ;
153162 }
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+ }
157167 }
158168
159169 private void 版本号说明ToolStripMenuItem_Click ( object sender , EventArgs e )
160170 {
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+ }
164175 }
165176
166177 private void 更改公告ToolStripMenuItem_Click ( object sender , EventArgs e )
167178 {
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+ }
172184 }
173185
174186 private void 日志查看ToolStripMenuItem_Click ( object sender , EventArgs e )
175187 {
176- FormLog flg = new FormLog ( ) ;
177- flg . ShowDialog ( ) ;
178- flg . Dispose ( ) ;
188+ using ( FormLog flg = new FormLog ( ) )
189+ {
190+ flg . ShowDialog ( ) ;
191+ }
179192 }
180193
181194 private void 注册账号ToolStripMenuItem_Click ( object sender , EventArgs e )
0 commit comments