Browse Source

zhao:增加是否录制麦克风和录音配置,检测重可以设置是否录制麦克风;取消设置重API设置,改为设置服务地址;添加打包脚本

tags/录制修改前
耀 3 years ago
parent
commit
713bb0a98e

+ 94
- 55
Common/system/FFMpeg.cs View File

@@ -49,10 +49,12 @@ namespace Common.system
49 49
         /// </summary>
50 50
         /// <param name="FilePath">文件存储路径</param>
51 51
         /// <param name="size">大小</param>
52
+        /// <param name="RecordingSound">录制音频</param>
53
+        /// <param name="RecordingMicrophone">录制麦克风</param>
52 54
         /// <param name="ErrMessage">错误信息</param>
53 55
         /// <param name="MicrophoneName">麦克风名</param>
54 56
         /// <returns></returns>
55
-        public bool StartRecordingVideo(string FilePath, Size size, out string ErrMessage, string MicrophoneName = null)
57
+        public bool StartRecordingVideo(string FilePath, Size size, bool RecordingSound, bool RecordingMicrophone, out string ErrMessage, string MicrophoneName = null)
56 58
         {
57 59
             while (myProcess != null)
58 60
             {
@@ -90,36 +92,44 @@ namespace Common.system
90 92
             {
91 93
 
92 94
             }
93
-            if (StartRecordSpeakerAudio(audioSpeakerPath))
95
+            //是否录制音频
96
+            if (RecordingSound)
94 97
             {
95
-                IsRecordSpeaker = true;
96
-            }
97
-            else
98
-            {
99
-                //无法录制扬声器音频
100
-                IsRecordSpeaker = false;
101
-            }
102
-            StopRecordAudio(2);
103
-            Thread.Sleep(100);
104
-            if (StartRecordAudio(audioMicrophonePath))
105
-            {
106
-                IsRecordMicrophone = true;
98
+                if (StartRecordSpeakerAudio(audioSpeakerPath))
99
+                {
100
+                    IsRecordSpeaker = true;
101
+                }
102
+                else
103
+                {
104
+                    //无法录制扬声器音频
105
+                    IsRecordSpeaker = false;
106
+                }
107
+                StopRecordAudio(2);
108
+                Thread.Sleep(100);
107 109
             }
108
-            else
110
+            //是否录制麦克风
111
+            if (RecordingMicrophone)
109 112
             {
110
-                //无法录制麦克风
111
-                IsRecordMicrophone = false;
113
+                if (StartRecordAudio(audioMicrophonePath))
114
+                {
115
+                    IsRecordMicrophone = true;
116
+                }
117
+                else
118
+                {
119
+                    //无法录制麦克风
120
+                    IsRecordMicrophone = false;
121
+                }
122
+                StopRecordAudio(1);
112 123
             }
113
-            StopRecordAudio(1);
114 124
             #endregion
115 125
             myProcess.StartInfo.FileName = FileToolsCommon.GetFileAbsolutePath(@"/ffmpeg/bin/ffmpeg.exe");   //ffmpeg.exe的绝对路径
116 126
             string SpeakerStr = "";
117 127
             string MicrophoneStr = "";
118
-            if (IsRecordSpeaker)
128
+            if (IsRecordSpeaker && RecordingSound)
119 129
             {
120 130
                 SpeakerStr = "-f dshow -i audio=\"virtual-audio-capturer\" ";
121 131
             }
122
-            if (IsRecordMicrophone)
132
+            if (IsRecordMicrophone && RecordingMicrophone)
123 133
             {
124 134
                 if (!string.IsNullOrWhiteSpace(MicrophoneName))
125 135
                 {
@@ -196,8 +206,10 @@ namespace Common.system
196 206
         /// </summary>
197 207
         /// <param name="Mp3Path">MP3音频位置</param>
198 208
         /// <param name="ErrMessage">错误信息</param>
209
+        /// <param name="RecordingSound">录制音频</param>
210
+        /// <param name="RecordingMicrophone">录制麦克风</param>
199 211
         /// <param name="MicrophoneName">麦克风名</param>
200
-        public bool StartRecordingAudio(string Mp3Path, out string ErrMessage, string MicrophoneName = null)
212
+        public bool StartRecordingAudio(string Mp3Path, out string ErrMessage, bool RecordingSound, bool RecordingMicrophone, string MicrophoneName = null)
201 213
         {
202 214
             ErrMessage = null;
203 215
             while (myProcess != null)
@@ -231,46 +243,58 @@ namespace Common.system
231 243
             {
232 244
 
233 245
             }
234
-            if (StartRecordSpeakerAudio(audioSpeakerPath))
246
+            if (RecordingSound)
235 247
             {
236
-                IsRecordSpeaker = true;
237
-            }
238
-            else
239
-            {
240
-                //无法录制扬声器音频
241
-                IsRecordSpeaker = false;
242
-            }
243
-            StopRecordAudio(2);
244
-            Thread.Sleep(100);
245
-            if (StartRecordAudio(audioMicrophonePath))
246
-            {
247
-                IsRecordMicrophone = true;
248
-            }
249
-            else
250
-            {
251
-                //无法录制麦克风
252
-                IsRecordMicrophone = false;
248
+                if (StartRecordSpeakerAudio(audioSpeakerPath))
249
+                {
250
+                    IsRecordSpeaker = true;
251
+                }
252
+                else
253
+                {
254
+                    //无法录制扬声器音频
255
+                    IsRecordSpeaker = false;
256
+                }
257
+                StopRecordAudio(2);
258
+                Thread.Sleep(100);
259
+                if (!IsRecordSpeaker)
260
+                {
261
+                    ErrMessage = "无法录制声音,请关闭杀毒软件,确保扬声器处于可用状态!";
262
+                    return false;
263
+                }
253 264
             }
254
-            StopRecordAudio(1);
255
-            if (!IsRecordSpeaker && !IsRecordMicrophone)
265
+            if (RecordingMicrophone)
256 266
             {
257
-                ErrMessage = "无法录制声音,请关闭杀毒软件,确保声卡和麦克风处于可用状态!";
258
-                return false;
267
+                if (StartRecordAudio(audioMicrophonePath))
268
+                {
269
+                    IsRecordMicrophone = true;
270
+                }
271
+                else
272
+                {
273
+                    //无法录制麦克风
274
+                    IsRecordMicrophone = false;
275
+                }
276
+                StopRecordAudio(1);
277
+                if (IsRecordMicrophone)
278
+                {
279
+                    ErrMessage = "无法录制麦克风,请关闭杀毒软件,确保麦克风处于可用状态!";
280
+                    return false;
281
+
282
+                }
259 283
             }
260 284
             #endregion
261 285
             myProcess = new Process();
262 286
             LogPath = CreateffmpegLog();
263 287
             myProcess.StartInfo.FileName = FileToolsCommon.GetFileAbsolutePath(@"/ffmpeg/bin/ffmpeg.exe");   //ffmpeg.exe的绝对路径
264
-            if (IsRecordSpeaker && IsRecordMicrophone)
288
+            if (IsRecordSpeaker && IsRecordMicrophone && RecordingSound && RecordingMicrophone)
265 289
             {
266 290
                 myProcess.StartInfo.Arguments = "-f dshow -i audio=\"virtual-audio-capturer\" -f dshow -i audio=\"" +
267 291
                         MicrophoneName + "\" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 " + PathName;
268 292
             }
269
-            else if (IsRecordSpeaker)
293
+            else if (IsRecordSpeaker && RecordingSound)
270 294
             {
271 295
                 myProcess.StartInfo.Arguments = "-f dshow -i audio=\"virtual-audio-capturer\" " + PathName;
272 296
             }
273
-            else if (IsRecordMicrophone)
297
+            else if (IsRecordMicrophone && RecordingMicrophone)
274 298
             {
275 299
                 //录制麦克风
276 300
                 if (!string.IsNullOrWhiteSpace(MicrophoneName))
@@ -349,12 +373,19 @@ namespace Common.system
349 373
         /// <param name="FilePath">文件存储路径 必须与开始时的路径完全一致</param>
350 374
         public bool StopFFmpeg(string FilePath)
351 375
         {
352
-            //文件完整路径
353
-            if (myProcess != null)
376
+            try
354 377
             {
355
-                myProcess.StandardInput.WriteLine("q");//在这个进程的控制台中模拟输入q,用于暂停录制
356
-                myProcess.Close();//关闭进程
357
-                myProcess.Dispose();//释放资源
378
+                //文件完整路径
379
+                if (myProcess != null)
380
+                {
381
+                    myProcess.StandardInput.WriteLine("q");//在这个进程的控制台中模拟输入q,用于暂停录制
382
+                    myProcess.Close();//关闭进程
383
+                    myProcess.Dispose();//释放资源
384
+                }
385
+            }
386
+            catch (Exception)
387
+            {
388
+                myProcess = null;
358 389
             }
359 390
             #region 进程是否已经释放
360 391
             bool IsRunning = true;
@@ -369,10 +400,18 @@ namespace Common.system
369 400
                 }
370 401
             }
371 402
             #endregion
372
-            myProcess = null;
373
-            Thread t1 = new Thread(MergeVideoOrAudio);
374
-            t1.Start(FilePath);
375
-            return true;
403
+            try
404
+            {
405
+                myProcess = null;
406
+                Thread t1 = new Thread(MergeVideoOrAudio);
407
+                t1.Start(FilePath);
408
+                return true;
409
+            }
410
+            catch (Exception ex)
411
+            {
412
+                LogHelper.WriteErrLog("【合成文件】:" + FilePath + "合成失败," + ex.Message, ex);
413
+                return false;
414
+            }
376 415
             //文件合成
377 416
         }
378 417
 

+ 60
- 0
XHWK.Model/Model_ServiceAddress.cs View File

@@ -0,0 +1,60 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace XHWK.Model
8
+{
9
+    /// <summary>
10
+    /// 服务地址模型
11
+    /// </summary>
12
+    public class Model_ServiceAddress
13
+    {
14
+        public string id;
15
+        public string createname;
16
+        public string page;
17
+        public string pageSize;
18
+        public string caid;
19
+        public string cloudid;
20
+
21
+        public string createtime;
22
+        public string cloudname;
23
+        public string cloudcode;
24
+        public string cloudstate;
25
+
26
+        /// <summary>
27
+        /// 外网接口地址
28
+        /// </summary>
29
+        public string wapi;
30
+        /// <summary>
31
+        /// 外网文件上传地址
32
+        /// </summary>
33
+        public string wfile;
34
+        /// <summary>
35
+        /// 外网文件下载地址
36
+        /// </summary>
37
+        public string wdown;
38
+        /// <summary>
39
+        /// 外网直播回放地址
40
+        /// </summary>
41
+        public string wlive;
42
+
43
+        /// <summary>
44
+        /// 内网接口地址
45
+        /// </summary>
46
+        public string napi;
47
+        /// <summary>
48
+        ///内网文件上传地址
49
+        /// </summary>
50
+        public string nfile;
51
+        /// <summary>
52
+        ///内网文件下载地址
53
+        /// </summary>
54
+        public string ndown;
55
+        /// <summary>
56
+        ///内网直播回放地址
57
+        /// </summary>
58
+        public string nlive;
59
+    }
60
+}

+ 1
- 0
XHWK.Model/XHWK.Model.csproj View File

@@ -59,6 +59,7 @@
59 59
     <Compile Include="Model_ResourceAddTwo.cs" />
60 60
     <Compile Include="Model_ResourceAdd.cs" />
61 61
     <Compile Include="Model_Screenshot.cs" />
62
+    <Compile Include="Model_ServiceAddress.cs" />
62 63
     <Compile Include="Model_Signatures.cs" />
63 64
     <Compile Include="Model_TmatrixCode.cs" />
64 65
     <Compile Include="Model_TsubjectbookList.cs" />

+ 11
- 4
XHWK.WKTool/App.config View File

@@ -9,8 +9,8 @@
9 9
 		<!--参数是否加密 0不加密 1加密-->
10 10
 		<add key="IsParameterEncryption" value="0" />
11 11
 		<!--版本号-->
12
-		<add key="VersionCode" value="74" />
13
-		<add key="VersionName" value="2.5.24" />
12
+		<add key="VersionCode" value="77" />
13
+		<add key="VersionName" value="2.5.27" />
14 14
 		<!--皮肤样式 0白 1蓝 2黑色 -->
15 15
 		<add key="SkinStyle" value="0" />
16 16
 		<!--是否输出视频记录日志:0否-->
@@ -21,14 +21,21 @@
21 21
 		<add key="VideoSavePath" value="D:\星火微课" />
22 22
 		<!--视频格式 1、MP4 2、FlV 3、AVI-->
23 23
 		<add key="VideoType" value="1" />
24
-		<!--声音 true 有 false 无-->
25
-		<add key="IsSound" value="true" />
24
+		<!--是否录制扬声器 1 有 0 否-->
25
+		<add key="IsRecordingSound" value="1" />
26
+		<!--是否录制麦克风 1 有 0 否-->
27
+		<add key="IsRecordingMicrophone" value="1" />
26 28
 		<!--图片压缩质量 0最差 100最佳-->
27 29
 		<add key="ImageCompressionLevel" value="70" />
28 30
 		<!--用户名-->
29 31
 		<add key="userName" value="" />
30 32
 		<!--记住密码-->
31 33
 		<add key="isRemind" value="" />
34
+		<!--是否为校外 1是 -->
35
+		<add key="IsOutsideSchool" value="1" />
36
+		<!--服务地址请求地址-->
37
+		<add key="ServiceAddressAPI" value="http://scapitest.xhkjedu.com" />
38
+		<!--<add key="ServiceAddressAPI" value="https://certapi.xhkjedu.com" />-->
32 39
 		<!--API请求地址-->
33 40
 		<add key="APIRequestAddress" value="http://schoolapi.xhkjedu.com" />
34 41
 		<!--文件平台请求地址-->

+ 131
- 47
XHWK.WKTool/App.cs View File

@@ -24,6 +24,7 @@ namespace XHWK.WKTool
24 24
     public partial class APP : Application
25 25
     {
26 26
         #region 全局变量
27
+        #region 更新需改动
27 28
         /// <summary>
28 29
         /// 是否为测试版
29 30
         /// </summary>
@@ -32,18 +33,21 @@ namespace XHWK.WKTool
32 33
         /// 参数是否加密
33 34
         /// </summary>
34 35
         public static bool IsParameterEncryption = FileToolsCommon.GetConfigValue("IsParameterEncryption") != "0";
36
+        #endregion
37
+
38
+        #region 接口地址
35 39
         /// <summary>
36
-        /// 是否输出测试记录日志
40
+        /// 是否为校外接口
37 41
         /// </summary>
38
-        public static bool IsOutputInfoLog = FileToolsCommon.GetConfigValue("IsOutputInfoLog") != "0";
42
+        public static bool IsOutsideSchool = FileToolsCommon.GetConfigValue("IsOutsideSchool") == "1";
39 43
         /// <summary>
40
-        /// 是否隐藏录屏工具栏
44
+        /// 服务地址
41 45
         /// </summary>
42
-        public static bool IsHideSRTool = FileToolsCommon.GetConfigValue("IsHideSRTool") != "0";
46
+        public static Model_ServiceAddress ServiceAddress = null;
43 47
         /// <summary>
44
-        /// 皮肤样式 0白 1蓝 2黑色
48
+        /// 服务地址API
45 49
         /// </summary>
46
-        public static string SkinStyle = FileToolsCommon.GetConfigValue("SkinStyle");
50
+        public static string ServiceAddressAPI = isDebug ? "http://scapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("ServiceAddressAPI");
47 51
         /// <summary>
48 52
         /// 接口地址
49 53
         /// </summary>
@@ -64,74 +68,73 @@ namespace XHWK.WKTool
64 68
         /// TQL铺码服务地址
65 69
         /// </summary>
66 70
         public static string TmatrixCodeURL = FileToolsCommon.GetConfigValue("TmatrixCode");
71
+        #endregion
72
+
73
+        #region 配置项
67 74
         /// <summary>
68
-        /// 数据存放目录
69
-        /// </summary>
70
-        public static string dataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
71
-        /// <summary>
72
-        /// 后台线程帮助类
75
+        /// 是否输出测试记录日志
73 76
         /// </summary>
74
-        public static BackgroundWorkerHelper BackgroundWorkerHelper => BackgroundWorkerHelper.GetInstance();
77
+        public static bool IsOutputInfoLog = FileToolsCommon.GetConfigValue("IsOutputInfoLog") != "0";
75 78
         /// <summary>
76
-        /// 签名
79
+        /// 是否隐藏录屏工具栏
77 80
         /// </summary>
78
-        public static string Signature = "";
79
-        public static string secretKey = "nanhuakaizhangjianwangni";
81
+        public static bool IsHideSRTool = FileToolsCommon.GetConfigValue("IsHideSRTool") != "0";
80 82
         /// <summary>
81
-        /// 用户信息
83
+        /// 皮肤样式 0白 1蓝 2黑色
82 84
         /// </summary>
83
-        public static Model_UserInfo UserInfo = null;
85
+        public static string SkinStyle = FileToolsCommon.GetConfigValue("SkinStyle");
84 86
         /// <summary>
85
-        /// 接口返回消息
87
+        /// 数据存放目录
86 88
         /// </summary>
87
-        public static string ServerMsg = string.Empty;
89
+        public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
88 90
         /// <summary>
89
-        /// 用户微课列表模型
91
+        /// 摄像头位置
90 92
         /// </summary>
91
-        public static List<Model_WKData> WKDataList = null;
93
+        public static string CameraPosition = string.Empty;
92 94
         /// <summary>
93
-        /// 微课模型
95
+        /// 摄像头名
94 96
         /// </summary>
95
-        public static Model_WKData WKData = null;
97
+        public static string CameraName = "";
96 98
         /// <summary>
97
-        /// 微课视频列表
99
+        /// 麦克风名
98 100
         /// </summary>
99
-        public static List<Model_Video> VideoList = null;
101
+        public static string MicrophoneName = "";
102
+        #endregion
103
+
104
+        #region 记录数据
100 105
         /// <summary>
101
-        /// 画板模型
106
+        /// 全局页面数据变量
102 107
         /// </summary>
103
-        public static List<Model_DrawData> PageDrawList = null;
108
+        public static readonly Model_Page PageContextData = new Model.Model_Page();
104 109
         /// <summary>
105 110
         /// 录屏工具
106 111
         /// </summary>
107 112
         public static FFMpeg FFmpeg = new FFMpeg();
108 113
         /// <summary>
109
-        /// 登录状态 false 未登录 true已登录
114
+        /// 后台线程帮助类
110 115
         /// </summary>
111
-        public static bool IsLoginType = false;
112
-        public static readonly Model_Page pageData = new Model.Model_Page();
116
+        public static BackgroundWorkerHelper BackgroundWorkerHelper => BackgroundWorkerHelper.GetInstance();
113 117
         /// <summary>
114
-        /// 防止图片地址重复
118
+        /// 签名
115 119
         /// </summary>
116
-        public static long num = 9999;
120
+        public static string Signature = "";
121
+        public static string secretKey = "nanhuakaizhangjianwangni";
117 122
         /// <summary>
118
-        /// 导入图片路径
123
+        /// 用户信息
119 124
         /// </summary>
120
-        public static string[] Paths = new string[] { };
125
+        public static Model_UserInfo UserInfo = null;
121 126
         /// <summary>
122
-        /// 截图图片路径
127
+        /// 接口返回消息
123 128
         /// </summary>
124
-        public static string[] JPaths = new string[999];
125
-        public static string ImgPath = string.Empty;
129
+        public static string ServerMsg = string.Empty;
126 130
         /// <summary>
127
-        /// 页码IP
131
+        /// 登录状态 false 未登录 true已登录
128 132
         /// </summary>
129
-        public static string[] OutPut = new string[] { };
130
-        public static string CameraPosition = string.Empty;
133
+        public static bool IsLoginType = false;
131 134
         /// <summary>
132
-        /// 数据存放目录
135
+        /// 截图地址
133 136
         /// </summary>
134
-        public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\";
137
+        public static string ImgPath = string.Empty;
135 138
         /// <summary>
136 139
         /// 教材列表
137 140
         /// </summary>
@@ -148,14 +151,28 @@ namespace XHWK.WKTool
148 151
         /// 是否正在上传
149 152
         /// </summary>
150 153
         public static bool IsUpLoad = false;
154
+        #endregion
155
+
156
+        #region 微课数据记录
151 157
         /// <summary>
152
-        /// 摄像头名
158
+        /// 用户微课列表模型
153 159
         /// </summary>
154
-        public static string CameraName = "";
160
+        public static List<Model_WKData> WKDataList = null;
155 161
         /// <summary>
156
-        /// 麦克风名
162
+        /// 微课模型
157 163
         /// </summary>
158
-        public static string MicrophoneName = "";
164
+        public static Model_WKData WKData = null;
165
+        /// <summary>
166
+        /// 微课视频列表
167
+        /// </summary>
168
+        public static List<Model_Video> VideoList = null;
169
+        /// <summary>
170
+        /// 画板模型
171
+        /// </summary>
172
+        public static List<Model_DrawData> PageDrawList = null;
173
+
174
+        #endregion
175
+
159 176
         #region 点阵笔
160 177
         /// <summary>
161 178
         /// 点阵笔
@@ -174,6 +191,7 @@ namespace XHWK.WKTool
174 191
         /// </summary>
175 192
         public static bool BoardStatus = false;
176 193
         #endregion
194
+
177 195
         #region 腾千里手写笔
178 196
         ///// <summary>
179 197
         ///// 铺码服务请求
@@ -202,6 +220,7 @@ namespace XHWK.WKTool
202 220
         #endregion
203 221
 
204 222
         #endregion
223
+
205 224
         #region 页面
206 225
         /// <summary>
207 226
         /// 主页面
@@ -329,7 +348,7 @@ namespace XHWK.WKTool
329 348
 
330 349
                 //如果本地文件为空,弹出弹窗 输密匙
331 350
                 //本地文件不为空, 解析
332
-                if (!File.Exists(APP.dataPath + "signature.txt"))//上次登录时间为空 或者签名为空 或者上次登录时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
351
+                if (!File.Exists(APP.DataPath + "signature.txt"))//上次登录时间为空 或者签名为空 或者上次登录时间不是今天   都需要输入密匙验证 ,否则只验证本地的签名
333 352
                 {
334 353
                     if (principal.IsInRole(WindowsBuiltInRole.Administrator))
335 354
                     {
@@ -576,6 +595,71 @@ namespace XHWK.WKTool
576 595
         }
577 596
         #endregion
578 597
 
598
+        #region 服务地址数据
599
+        /// <summary>
600
+        /// 服务地址存储到本地
601
+        /// </summary>
602
+        public static void SaveServiceAddressData()
603
+        {
604
+            try
605
+            {
606
+                if (ServiceAddress == null)
607
+                {
608
+                    return;
609
+                }
610
+                string DateXmlStr = XmlUtilHelper.XmlSerialize(ServiceAddress);
611
+                string SavePath = DataPath;
612
+                FileToolsCommon.CreateDirectory(SavePath);
613
+                string SaveName = SavePath + "ServiceAddress.d";
614
+                FileToolsCommon.DeleteFile(SaveName);
615
+                FileToolsCommon.WriteText(SaveName, DateXmlStr);
616
+            }
617
+            catch (Exception ex)
618
+            {
619
+                LogHelper.WriteErrLog("【服务地址存储】(SaveServiceAddressData)保存失败:" + ex.Message, ex);
620
+            }
621
+        }
622
+        /// <summary>
623
+        /// 从本地读取服务地址
624
+        /// </summary>
625
+        public static void ReadServiceAddressData()
626
+        {
627
+            try
628
+            {
629
+                string SavePath = DataPath;
630
+                FileToolsCommon.CreateDirectory(SavePath);
631
+                string SaveName = SavePath + "ServiceAddress.d";
632
+                //文件若存在则读取
633
+                if (FileToolsCommon.IsExistFile(SaveName))
634
+                {
635
+                    string DateXmlStr = FileToolsCommon.FileToString(SaveName);
636
+                    ServiceAddress = XmlUtilHelper.DESerializer<Model_ServiceAddress>(DateXmlStr);
637
+                    SwitchAddress();
638
+                }
639
+            }
640
+            catch (Exception ex)
641
+            {
642
+                LogHelper.WriteErrLog("【服务地址读取】(ReadServiceAddressData)读取失败:" + ex.Message, ex);
643
+            }
644
+        }
645
+        /// <summary>
646
+        /// 切换校内外网
647
+        /// </summary>
648
+        public static void SwitchAddress()
649
+        {
650
+            try
651
+            {
652
+                apiUrl = IsOutsideSchool ? ServiceAddress.wapi : ServiceAddress.napi;
653
+                uploadUrl = (IsOutsideSchool ? ServiceAddress.wfile : ServiceAddress.nfile) + "/static/";
654
+                showImageUrl = IsOutsideSchool ? ServiceAddress.wdown : ServiceAddress.ndown;
655
+            }
656
+            catch (Exception ex)
657
+            {
658
+                LogHelper.WriteErrLog("【服务地址切换】(SwitchAddress)服务复制切换失败,请求地址为空!", ex);
659
+            }
660
+        }
661
+        #endregion
662
+
579 663
         #region 检测安装Screen Capturer Recorder
580 664
         /// <summary>
581 665
         /// 检测是否安装了Screen Capturer Recorder

+ 2
- 0
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

@@ -326,6 +326,8 @@ namespace XHWK.WKTool
326 326
         {
327 327
             new Thread(o =>
328 328
             {
329
+                //读取本地
330
+                APP.ReadServiceAddressData();
329 331
                 int versionThis = int.Parse(FileToolsCommon.GetConfigValue("VersionCode"));
330 332
                 if (versionThis < 0)
331 333
                 {

+ 48
- 3
XHWK.WKTool/DAL/Interface.cs View File

@@ -49,11 +49,11 @@ namespace XHWK.WKTool.DAL
49 49
                         if (obj["code"].ToString().Equals("0"))
50 50
                         {
51 51
                             APP.Signature = obj["obj"].ToString();
52
-                            if (!Directory.Exists(APP.dataPath))
52
+                            if (!Directory.Exists(APP.DataPath))
53 53
                             {
54
-                                Directory.CreateDirectory(APP.dataPath);
54
+                                Directory.CreateDirectory(APP.DataPath);
55 55
                             }
56
-                            string ApplicationData = APP.dataPath + "signature.txt";
56
+                            string ApplicationData = APP.DataPath + "signature.txt";
57 57
 
58 58
                             System.IO.File.WriteAllText(ApplicationData, APP.Signature, Encoding.Default);//存放签名
59 59
                             return 0;
@@ -320,5 +320,50 @@ namespace XHWK.WKTool.DAL
320 320
                 return 1;
321 321
             }
322 322
         }
323
+
324
+        /// <summary>
325
+        /// 请求服务地址
326
+        /// </summary>
327
+        /// <param name="Schoolcode"></param>
328
+        /// <returns></returns>
329
+        public bool GetServiceAddress(string Schoolcode, out string Message)
330
+        {
331
+            string url = APP.ServiceAddressAPI + "/school/find_code";//地址
332
+
333
+            Dictionary<string, object> dic = new Dictionary<string, object>
334
+            {
335
+                { "schoolcode", Schoolcode}
336
+            };
337
+            string body = JsonHelper.ToJson(dic);
338
+            ResultVo<Model_ServiceAddress> result = HttpHelper.PostAndRespSignle<ResultVo<Model_ServiceAddress>>(url, postData: body);
339
+            if (result != null)
340
+            {
341
+                if (result.code == 0)
342
+                {
343
+                    if (result.obj != null)
344
+                    {
345
+                        Message = result.msg;
346
+                        APP.ServiceAddress = result.obj;
347
+                        APP.SaveServiceAddressData();
348
+                        return true;
349
+                    }
350
+                    else
351
+                    {
352
+                        Message = "服务地址错误,请输入正确的地址!";
353
+                        return false;
354
+                    }
355
+                }
356
+                else
357
+                {
358
+                    Message = result.msg;
359
+                    return false;
360
+                }
361
+            }
362
+            else
363
+            {
364
+                Message = "无法与服务器建立连接,请检查网络状态。";
365
+                return false;
366
+            }
367
+        }
323 368
     }
324 369
 }

+ 7
- 3
XHWK.WKTool/DeviceWindow.xaml View File

@@ -127,7 +127,7 @@
127 127
                     </StackPanel>
128 128
                 </Border>
129 129
             </Grid>
130
-            <Grid x:Name="GridDetection" Grid.Column="1" Margin="25,15" Visibility="Collapsed">
130
+            <Grid x:Name="GridDetection" Grid.Column="1" Margin="25,15" Visibility="Visible">
131 131
                 <Grid.ColumnDefinitions>
132 132
                     <ColumnDefinition Width="50*"/>
133 133
                     <ColumnDefinition Width="50*"/>
@@ -184,7 +184,7 @@
184 184
                     </Button>
185 185
                 </Grid>
186 186
             </Grid>
187
-            <Grid x:Name="GridCamera" Grid.Column="1" Visibility="Visible">
187
+            <Grid x:Name="GridCamera" Grid.Column="1" Visibility="Collapsed">
188 188
                 <Grid.RowDefinitions>
189 189
                     <RowDefinition Height="66*"/>
190 190
                     <RowDefinition Height="250*"/>
@@ -329,10 +329,14 @@
329 329
                     </Button>
330 330
                     <MediaElement x:Name="MediaAudioMicPlay" Stretch="Fill" LoadedBehavior="Manual" Width="0" Volume="1" MediaEnded="MediaAudioMicPlay_MediaEnded" Visibility="Hidden"/>
331 331
                 </StackPanel>
332
-                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,0,0,0">
332
+                <Grid Grid.Row="3">
333
+                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="30,0,0,0">
333 334
                     <TextBlock Text="麦克风采集:" FontSize="17"  Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
334 335
                     <TextBlock x:Name="TbxMicrophoneDetection" Text="待检测" FontSize="17"  Foreground="#FF000000" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" ></TextBlock>
335 336
                 </StackPanel>
337
+                    <CheckBox x:Name="CbxRecordingMicrophone" Content="录制麦克风" HorizontalAlignment="Left" FontSize="16" Margin="30,40,0,0" VerticalAlignment="Top" Padding="5,0,0,0" VerticalContentAlignment="Center" IsChecked="True" Click="CbxRecordingMicrophone_Click"/>
338
+
339
+                </Grid>
336 340
                 <!--<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0">
337 341
                 </StackPanel>-->
338 342
                 <Grid Grid.Row="2">

+ 52
- 7
XHWK.WKTool/DeviceWindow.xaml.cs View File

@@ -32,6 +32,15 @@ namespace XHWK.WKTool
32 32
             BtnDetection.Content = "开始检测";
33 33
             HidePage();
34 34
             GridDetection.Visibility = Visibility.Visible;
35
+            bool IsRecordingMicrophone = FileToolsCommon.GetConfigValue("IsRecordingMicrophone") == "1";
36
+            if(IsRecordingMicrophone)
37
+            {
38
+                CbxRecordingMicrophone.IsChecked = true;
39
+            }
40
+            else
41
+            {
42
+                CbxRecordingMicrophone.IsChecked = false;
43
+            }
35 44
         }
36 45
         /// <summary>
37 46
         /// 窗体移动
@@ -191,6 +200,8 @@ namespace XHWK.WKTool
191 200
                         Dispatcher.Invoke(() =>
192 201
                         {
193 202
                             TxbMicrophone.Text = "不可用";
203
+                            CbxRecordingMicrophone.IsChecked = false;
204
+                            FileToolsCommon.SetConfigValue("IsRecordingMicrophone", "0");
194 205
                         });
195 206
                     }
196 207
                     APP.FFmpeg.StopRecordAudio(1);
@@ -487,13 +498,28 @@ namespace XHWK.WKTool
487 498
                 }
488 499
                 if (Record)
489 500
                 {
490
-                    Dispatcher.Invoke(() =>
501
+                    if (FileToolsCommon.IsExistFile(audioMicrophonePath))
491 502
                     {
492
-                        TbxMicrophoneDetection.Text = "录制成功";
493
-                        BtnMicrophoneDetectionPlay.Visibility = Visibility.Visible;
494
-                        //GridMicImg.Visibility = Visibility.Visible;
495
-                        MediaAudioMicPlay.Source = new Uri(audioMicrophonePath);
496
-                    });
503
+                        Dispatcher.Invoke(() =>
504
+                        {
505
+                            TbxMicrophoneDetection.Text = "录制成功";
506
+                            BtnMicrophoneDetectionPlay.Visibility = Visibility.Visible;
507
+                            //GridMicImg.Visibility = Visibility.Visible;
508
+                            MediaAudioMicPlay.Source = new Uri(audioMicrophonePath);
509
+                        });
510
+                    }
511
+                    else
512
+                    {
513
+                        //无法录制麦克风
514
+                        Dispatcher.Invoke(() =>
515
+                        {
516
+                            TbxMicrophoneDetection.Text = "不可用";
517
+                            BtnMicrophoneDetectionPlay.Visibility = Visibility.Hidden;
518
+                            CbxRecordingMicrophone.IsChecked = false;
519
+                            FileToolsCommon.SetConfigValue("IsRecordingMicrophone", "0");
520
+                            //GridMicImg.Visibility = Visibility.Hidden;
521
+                        });
522
+                    }
497 523
                 }
498 524
                 else
499 525
                 {
@@ -502,6 +528,8 @@ namespace XHWK.WKTool
502 528
                     {
503 529
                         TbxMicrophoneDetection.Text = "不可用";
504 530
                         BtnMicrophoneDetectionPlay.Visibility = Visibility.Hidden;
531
+                        CbxRecordingMicrophone.IsChecked = false;
532
+                        FileToolsCommon.SetConfigValue("IsRecordingMicrophone", "0");
505 533
                         //GridMicImg.Visibility = Visibility.Hidden;
506 534
                     });
507 535
                 }
@@ -539,6 +567,23 @@ namespace XHWK.WKTool
539 567
             BtnMicrophoneDetectionPlay.IsEnabled = true;
540 568
             ImgMicAcousticWave.Visibility = Visibility.Hidden;
541 569
         }
570
+
571
+        /// <summary>
572
+        /// 修改录制麦克风
573
+        /// </summary>
574
+        /// <param name="sender"></param>
575
+        /// <param name="e"></param>
576
+        private void CbxRecordingMicrophone_Click(object sender, RoutedEventArgs e)
577
+        {
578
+            if ((bool)CbxRecordingMicrophone.IsChecked)
579
+            {
580
+                FileToolsCommon.SetConfigValue("IsRecordingMicrophone", "1");
581
+            }
582
+            else
583
+            {
584
+                FileToolsCommon.SetConfigValue("IsRecordingMicrophone", "0");
585
+            }
586
+        }
542 587
         #endregion
543 588
 
544 589
         #region 页面切换
@@ -668,8 +713,8 @@ namespace XHWK.WKTool
668 713
             {
669 714
             }
670 715
         }
671
-        #endregion
672 716
 
717
+        #endregion
673 718
 
674 719
     }
675 720
 }

+ 1
- 0
XHWK.WKTool/JieTuWindow.xaml.cs View File

@@ -251,6 +251,7 @@ namespace ComeCapture
251 251
 
252 252
         #region 获取截图
253 253
 
254
+
254 255
         private void GetCapture()
255 256
         {
256 257
 

+ 3
- 3
XHWK.WKTool/KeyVerification.xaml.cs View File

@@ -96,11 +96,11 @@ namespace XHWK.WKTool
96 96
         /// <returns></returns>
97 97
         public void InvokeActivationAddHistoryServerCompate(object obj)
98 98
         {
99
-            if (!Directory.Exists(APP.dataPath))
99
+            if (!Directory.Exists(APP.DataPath))
100 100
             {
101
-                Directory.CreateDirectory(APP.dataPath);
101
+                Directory.CreateDirectory(APP.DataPath);
102 102
             }
103
-            string ApplicationData = APP.dataPath + "signatureTime.txt";
103
+            string ApplicationData = APP.DataPath + "signatureTime.txt";
104 104
             string currentTime = DateTime.Now.ToLongDateString().ToString();//当前时间
105 105
             System.IO.File.WriteAllText(ApplicationData, currentTime, Encoding.Default);//存放签名验证日期
106 106
         }

+ 1
- 1
XHWK.WKTool/LatticeXML/S0_O000_B0000_P000-255.tmx View File

@@ -1 +1 @@
1
-S0,O000,B0000,P000-255,D2021/6/30;CC8FB26BWW8K0LR0COOSWE4KSOKA4K4VQ
1
+S0,O000,B0000,P000-255,D2023/7/2;CCCR7ZH0O68K0LUF6OOO0IS8S6O642UO

+ 99
- 6
XHWK.WKTool/LoginWindow.xaml View File

@@ -77,7 +77,7 @@
77 77
             <Grid>
78 78
                 <Image Source="/SkinImages/ImgCarousel/CM_RightDown.png" HorizontalAlignment="Right" VerticalAlignment="Top" Width="80" />
79 79
                 <!--创建内页 375-->
80
-                <Grid Margin="20,0">
80
+                <Grid x:Name="GridLoginPage" Margin="20,0" Visibility="Collapsed">
81 81
                     <Grid.RowDefinitions>
82 82
                         <RowDefinition Height="100*"/>
83 83
                         <RowDefinition Height="70*"/>
@@ -91,7 +91,7 @@
91 91
                             <Label Content="星火微课系统" FontSize="14" Foreground="#FF000000" VerticalAlignment="Top" HorizontalAlignment="Left" />
92 92
                         </StackPanel>
93 93
                     </Grid>
94
-                    <!--讲解名称-->
94
+                    <!--账号-->
95 95
                     <Grid Grid.Row="1">
96 96
                         <StackPanel VerticalAlignment="Center">
97 97
                             <Label Content="账号:" FontSize="12" Foreground="#FF666666"/>
@@ -99,7 +99,7 @@
99 99
                             <Label Background="#FF317EEC" Height="1.5"/>
100 100
                         </StackPanel>
101 101
                     </Grid>
102
-                    <!--存放路径-->
102
+                    <!--密码-->
103 103
                     <Grid Grid.Row="2">
104 104
                         <StackPanel VerticalAlignment="Center">
105 105
                             <Label Content="密码:" FontSize="12" Foreground="#FF666666"/>
@@ -122,7 +122,7 @@
122 122
                                 Background="#F7F7F7" Margin="11,0,0,0"/>
123 123
                             </StackPanel>-->
124 124
                     </Grid>
125
-                    <!--按钮-->
125
+                    <!--记住密码 切换网络-->
126 126
                     <Grid Grid.Row="3">
127 127
                         <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
128 128
                             <Viewbox VerticalAlignment="Center" Margin="0,0,5,0">
@@ -133,8 +133,100 @@
133 133
 
134 134
                         <Label x:Name="LblCreate" Content="创建微课中..." FontSize="12" Foreground="#FF999999" HorizontalAlignment="Right" Visibility="Hidden" Margin="0"/>
135 135
                     </Grid>
136
+                    <!--按钮-->
137
+                    <Grid Grid.Row="4">
138
+                        <Grid.RowDefinitions>
139
+                            <RowDefinition Height="35*"/>
140
+                            <RowDefinition Height="35*"/>
141
+                            <RowDefinition Height="5*"/>
142
+                            <RowDefinition Height="35*"/>
143
+                            <RowDefinition Height="15*"/>
144
+                            <RowDefinition Height="25*"/>
145
+                            <RowDefinition Height="5*"/>
146
+                        </Grid.RowDefinitions>
147
+                        <Button Grid.Row="1" Cursor="Hand" x:Name="btnStart" IsDefault="True" Content="登录" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"  Click="BtnStart_Click" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
148
+                            <Button.Template>
149
+                                <ControlTemplate TargetType="{x:Type Button}">
150
+                                    <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="20">
151
+                                        <Border.Background>#FF1D64DA</Border.Background>
152
+                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding ContentControl.Content}" Margin="0,5" />
153
+                                    </Border>
154
+                                </ControlTemplate>
155
+                            </Button.Template>
156
+                        </Button>
157
+                        <Button Grid.Row="3" Cursor="Hand" x:Name="BtnStop" IsDefault="True" Content="关闭" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0" Click="BtnDown_Click" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" Padding="2" VerticalContentAlignment="Center">
158
+                            <Button.Template>
159
+                                <ControlTemplate TargetType="{x:Type Button}">
160
+                                    <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="20">
161
+                                        <Border.Background>#FFC3C3C3</Border.Background>
162
+                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding ContentControl.Content}" Margin="0,5" />
163
+                                    </Border>
164
+                                </ControlTemplate>
165
+                            </Button.Template>
166
+                        </Button>
167
+
168
+                        <Button Grid.Row="5" FontSize="{Binding WordSize12}" Cursor="Hand" x:Name="BtnServiceAddress" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnServiceAddress_Click" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Stretch" >
169
+                            <Button.Template>
170
+                                <ControlTemplate TargetType="{x:Type Button}">
171
+                                    <Grid>
172
+                                        <Label Grid.Column="1" x:Name="Word" Content="服务地址设置" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FFC3C3C3"/>
173
+                                    </Grid>
174
+                                    <ControlTemplate.Triggers>
175
+                                        <Trigger Property="IsMouseOver" Value="True">
176
+                                            <Setter TargetName="Word" Property="Foreground" Value="#FF3F6FFF"/>
177
+                                        </Trigger>
178
+                                    </ControlTemplate.Triggers>
179
+                                </ControlTemplate>
180
+                            </Button.Template>
181
+                        </Button>
182
+                    </Grid>
183
+                </Grid>
184
+                <Grid x:Name="GridServiceAddress" Margin="20,0" Visibility="Visible">
185
+                    <Grid.RowDefinitions>
186
+                        <RowDefinition Height="100*"/>
187
+                        <RowDefinition Height="80*"/>
188
+                        <RowDefinition Height="70*"/>
189
+                        <RowDefinition Height="15*"/>
190
+                        <RowDefinition Height="120*"/>
191
+                    </Grid.RowDefinitions>
192
+                    <Grid Grid.Row="0">
193
+                        <StackPanel Margin="0,30,0,0">
194
+                            <Label Content="服务地址" FontSize="28" Foreground="#FF4B62EA" VerticalAlignment="Top" HorizontalAlignment="Left"  />
195
+                            <Label Content="设置" FontSize="14" Foreground="#FF000000" VerticalAlignment="Top" HorizontalAlignment="Left" />
196
+                        </StackPanel>
197
+                    </Grid>
198
+
199
+                    <!--服务地址-->
200
+                    <Grid Grid.Row="1">
201
+                        <StackPanel VerticalAlignment="Center">
202
+                            <Label Content="服务地址:" FontSize="12" Foreground="#FF666666"/>
203
+                            <TextBox x:Name="TbxServiceAddress" InputMethod.IsInputMethodEnabled="False" Text="" FontSize="14" Foreground="#FF999999" BorderBrush="{x:Null}" BorderThickness="0" Margin="5,5"/>
204
+                            <Label Background="#FF317EEC" Height="1.5"/>
205
+                        </StackPanel>
206
+                    </Grid>
207
+
208
+                    <!--切换网络-->
209
+                    <Grid Grid.Row="2">
210
+                        <StackPanel VerticalAlignment="Center">
211
+                            <Label Content="切换网络:" FontSize="12" Foreground="#FF666666"/>
212
+                            <StackPanel Orientation="Horizontal" Grid.Row="6" HorizontalAlignment="Left" Margin="0,10,0,0">
213
+                                <RadioButton x:Name="RbnIsOutsideSchool" Content="校外" FontSize="14" HorizontalAlignment="Left" Foreground="#FF333333"  Margin="20,0,0,0" IsChecked="True" Checked="RbnIsOutsideSchool_Checked" VerticalContentAlignment="Center"/>
214
+                                <RadioButton x:Name="RbnSchool" Content="校内" FontSize="14" HorizontalAlignment="Left" Foreground="#FF333333" Margin="20,0,0,0" Checked="RbnSchool_Checked" VerticalContentAlignment="Center"/>
215
+                            </StackPanel>
216
+                        </StackPanel>
217
+                    </Grid>
218
+                    <!--按钮-->
136 219
                     <Grid Grid.Row="4">
137
-                        <Button  Cursor="Hand" x:Name="btnStart" IsDefault="True" Content="登录" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,0,50" Click="BtnStart_Click" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
220
+                        <Grid.RowDefinitions>
221
+                            <RowDefinition Height="35*"/>
222
+                            <RowDefinition Height="35*"/>
223
+                            <RowDefinition Height="5*"/>
224
+                            <RowDefinition Height="35*"/>
225
+                            <RowDefinition Height="15*"/>
226
+                            <RowDefinition Height="25*"/>
227
+                            <RowDefinition Height="5*"/>
228
+                        </Grid.RowDefinitions>
229
+                        <Button Grid.Row="1" Cursor="Hand" x:Name="BtnSetServiceAddress" IsDefault="True" Content="设置" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Click="BtnSetServiceAddress_Click">
138 230
                             <Button.Template>
139 231
                                 <ControlTemplate TargetType="{x:Type Button}">
140 232
                                     <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="20">
@@ -144,7 +236,7 @@
144 236
                                 </ControlTemplate>
145 237
                             </Button.Template>
146 238
                         </Button>
147
-                        <Button Cursor="Hand" x:Name="BtnStop" IsDefault="True" Content="关闭" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,40,0,0" Click="BtnDown_Click" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" HorizontalContentAlignment="Center" Padding="2" VerticalContentAlignment="Center">
239
+                        <Button Grid.Row="3" Cursor="Hand" x:Name="BtnCancel" IsDefault="True" Content="取消" FontSize="18" FontWeight="Bold" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" Padding="2" VerticalContentAlignment="Center" Click="BtnCancel_Click">
148 240
                             <Button.Template>
149 241
                                 <ControlTemplate TargetType="{x:Type Button}">
150 242
                                     <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="1" CornerRadius="20">
@@ -154,6 +246,7 @@
154 246
                                 </ControlTemplate>
155 247
                             </Button.Template>
156 248
                         </Button>
249
+
157 250
                     </Grid>
158 251
                 </Grid>
159 252
             </Grid>

+ 97
- 1
XHWK.WKTool/LoginWindow.xaml.cs View File

@@ -24,6 +24,14 @@ namespace XHWK.WKTool
24 24
         public LoginWindow()
25 25
         {
26 26
             InitializeComponent();
27
+
28
+            #region 获取服务接口地址 --2021年7月9日赵耀
29
+            if (APP.ServiceAddress == null)
30
+            {
31
+                MessageWindow.Show("首次使用需设置服务地址。");
32
+                BtnServiceAddress_Click(null, null);
33
+            }
34
+            #endregion
27 35
             //if (APP.SkinStyle == "1")
28 36
             //{
29 37
             //    GridTitle.Visibility = Visibility.Visible;
@@ -43,7 +51,6 @@ namespace XHWK.WKTool
43 51
         }
44 52
         public void Initialize()
45 53
         {
46
-
47 54
             if (FileToolsCommon.IsExistFile(APP.DataPath + "accountNumber.txt"))
48 55
             {
49 56
                 string accountNumber = System.IO.File.ReadAllText(APP.DataPath + "accountNumber.txt", Encoding.Default);
@@ -53,6 +60,7 @@ namespace XHWK.WKTool
53 60
                     ckSaveName.IsChecked = true;
54 61
                 }
55 62
             }
63
+            DataContext = APP.PageContextData;
56 64
             //if (GetSettingString("isRemind").Equals("True"))
57 65
             //{
58 66
             //    ckSaveName.IsChecked = true;
@@ -77,6 +85,14 @@ namespace XHWK.WKTool
77 85
         /// <param name="e"></param>
78 86
         private void BtnStart_Click(object sender, RoutedEventArgs e)
79 87
         {
88
+            #region 获取服务接口地址 --2021年7月9日赵耀
89
+            if (APP.ServiceAddress == null)
90
+            {
91
+                MessageWindow.Show("首次使用需设置服务地址。");
92
+                BtnServiceAddress_Click(null, null);
93
+                return;
94
+            }
95
+            #endregion
80 96
             if (string.IsNullOrEmpty(txbAccountNumber.Text))
81 97
             {
82 98
                 MessageWindow.Show("账号未输入");
@@ -259,5 +275,85 @@ namespace XHWK.WKTool
259 275
         {
260 276
             DragMove();
261 277
         }
278
+
279
+        #region 服务地址
280
+        /// <summary>
281
+        /// 打开服务地址
282
+        /// </summary>
283
+        /// <param name="sender"></param>
284
+        /// <param name="e"></param>
285
+        private void BtnServiceAddress_Click(object sender, RoutedEventArgs e)
286
+        {
287
+            GridLoginPage.Visibility = Visibility.Collapsed;
288
+            GridServiceAddress.Visibility = Visibility.Visible;
289
+        }
290
+        /// <summary>
291
+        /// 取消
292
+        /// </summary>
293
+        /// <param name="sender"></param>
294
+        /// <param name="e"></param>
295
+        private void BtnCancel_Click(object sender, RoutedEventArgs e)
296
+        {
297
+            GridLoginPage.Visibility = Visibility.Visible;
298
+            GridServiceAddress.Visibility = Visibility.Collapsed;
299
+        }
300
+        /// <summary>
301
+        /// 服务地址设置
302
+        /// </summary>
303
+        /// <param name="sender"></param>
304
+        /// <param name="e"></param>
305
+        private void BtnSetServiceAddress_Click(object sender, RoutedEventArgs e)
306
+        {
307
+            #region 获取服务地址 -- 2021年7月8日赵耀
308
+            if (!string.IsNullOrWhiteSpace(TbxServiceAddress.Text))
309
+            {
310
+                if (@interface.GetServiceAddress(TbxServiceAddress.Text, out string Message))
311
+                {
312
+                    APP.SaveServiceAddressData();
313
+                    APP.SwitchAddress();
314
+
315
+                    MessageWindow.Show("设置成功!");
316
+                    BtnCancel_Click(null, null);
317
+                }
318
+                else
319
+                {
320
+                    MessageWindow.Show(Message);
321
+                    return;
322
+                }
323
+            }
324
+            #endregion
325
+        }
326
+
327
+        #region 切换校内外
328
+        /// <summary>
329
+        /// 校外
330
+        /// </summary>
331
+        /// <param name="sender"></param>
332
+        /// <param name="e"></param>
333
+        private void RbnIsOutsideSchool_Checked(object sender, RoutedEventArgs e)
334
+        {
335
+            APP.IsOutsideSchool = true;
336
+            FileToolsCommon.SetConfigValue("IsOutsideSchool", "1");
337
+            if (APP.ServiceAddress != null)
338
+            {
339
+                APP.SwitchAddress();
340
+            }
341
+        }
342
+        /// <summary>
343
+        /// 校内
344
+        /// </summary>
345
+        /// <param name="sender"></param>
346
+        /// <param name="e"></param>
347
+        private void RbnSchool_Checked(object sender, RoutedEventArgs e)
348
+        {
349
+            APP.IsOutsideSchool = false;
350
+            FileToolsCommon.SetConfigValue("IsOutsideSchool", "0");
351
+            if (APP.ServiceAddress != null)
352
+            {
353
+                APP.SwitchAddress();
354
+            }
355
+        }
356
+        #endregion
357
+        #endregion
262 358
     }
263 359
 }

+ 6
- 6
XHWK.WKTool/ProductVerification.xaml.cs View File

@@ -48,16 +48,16 @@ namespace XHWK.WKTool
48 48
             //解析
49 49
             try
50 50
             {
51
-                APP.Signature = System.IO.File.ReadAllText(APP.dataPath + "signature.txt", Encoding.Default);
51
+                APP.Signature = System.IO.File.ReadAllText(APP.DataPath + "signature.txt", Encoding.Default);
52 52
                 string decrypt = DataProvider.TripleDESDecrypt(APP.Signature, APP.secretKey);
53 53
                 decrypt = decrypt.Replace("\u0001", "").Replace("\u0007", "").Trim();
54 54
                 Model_Signatures msgBean = JsonHelper.JsonToObj<Model_Signatures>(decrypt);
55 55
                 long currentTimeTimestamp = DataProvider.TimestampTotalSeconds(); //当前时间 时间戳
56 56
                 if (msgBean.endtime > currentTimeTimestamp)//条件成立  解析成功 code 在有效期内
57 57
                 {
58
-                    if (File.Exists(APP.dataPath + "signatureTime.txt"))
58
+                    if (File.Exists(APP.DataPath + "signatureTime.txt"))
59 59
                     {
60
-                        string signatureTime = System.IO.File.ReadAllText(APP.dataPath + "signatureTime.txt", Encoding.Default);
60
+                        string signatureTime = System.IO.File.ReadAllText(APP.DataPath + "signatureTime.txt", Encoding.Default);
61 61
                         string currentTime = DateTime.Now.ToLongDateString().ToString();//当前时间  
62 62
                         if (signatureTime != currentTime)
63 63
                         {
@@ -118,11 +118,11 @@ namespace XHWK.WKTool
118 118
         /// <returns></returns>
119 119
         public void InvokeActivationAddHistoryServerCompate(object obj)
120 120
         {
121
-            if (!Directory.Exists(APP.dataPath))
121
+            if (!Directory.Exists(APP.DataPath))
122 122
             {
123
-                Directory.CreateDirectory(APP.dataPath);
123
+                Directory.CreateDirectory(APP.DataPath);
124 124
             }
125
-            string ApplicationData = APP.dataPath + "signatureTime.txt";
125
+            string ApplicationData = APP.DataPath + "signatureTime.txt";
126 126
             string currentTime = DateTime.Now.ToLongDateString().ToString();//当前时间
127 127
             System.IO.File.WriteAllText(ApplicationData, currentTime, Encoding.Default);//存放签名验证日期
128 128
         }

+ 2
- 2
XHWK.WKTool/Properties/AssemblyInfo.cs View File

@@ -49,5 +49,5 @@ using System.Windows;
49 49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50 50
 //通过使用 "*",如下所示:
51 51
 // [assembly: AssemblyVersion("1.0.*")]
52
-[assembly: AssemblyVersion("2.5.24.0")]
53
-[assembly: AssemblyFileVersion("2.5.24.0")]
52
+[assembly: AssemblyVersion("2.5.27.0")]
53
+[assembly: AssemblyFileVersion("2.5.27.0")]

+ 3
- 2
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

@@ -74,7 +74,6 @@ namespace XHWK.WKTool
74 74
         {
75 75
             InitializeComponent();
76 76
             ResizeMode = ResizeMode.NoResize;
77
-
78 77
         }
79 78
         /// <summary>
80 79
         /// 初始化
@@ -458,7 +457,9 @@ namespace XHWK.WKTool
458 457
                             Thread.Sleep(100);
459 458
                         }
460 459
                         System.Drawing.Size DesktopSize = PrimaryScreen.DESKTOP;
461
-                        bool SynRes = APP.FFmpeg.StartRecordingVideo(VideoSavePathName, DesktopSize, out string ErrMessage, APP.MicrophoneName);
460
+                        bool IsRecordingSound = FileToolsCommon.GetConfigValue("IsRecordingSound") == "1"; 
461
+                        bool IsRecordingMicrophone = FileToolsCommon.GetConfigValue("IsRecordingMicrophone") == "1";
462
+                        bool SynRes = APP.FFmpeg.StartRecordingVideo(VideoSavePathName, DesktopSize, IsRecordingSound, IsRecordingMicrophone, out string ErrMessage, APP.MicrophoneName);
462 463
 
463 464
                         Thread.Sleep(1300);
464 465
                         Dispatcher.Invoke(() =>

+ 1
- 1
XHWK.WKTool/UControl/Uc_VideoItem.xaml.cs View File

@@ -56,7 +56,7 @@ namespace XHWK.WKTool.UControl
56 56
             InitializeComponent();
57 57
             APP.IsUpLoad = false;
58 58
             VideoModel = model_Video;
59
-            DataContext = APP.pageData;
59
+            DataContext = APP.PageContextData;
60 60
             if (FileToolsCommon.IsExistFile(VideoModel.ThumbnailPath))
61 61
             {
62 62
                 ImgVideo.Source = ImageHelper.ReadBitmapImageFile(VideoModel.ThumbnailPath);// new BitmapImage(new Uri(VideoModel.ThumbnailPath));

+ 1
- 1
XHWK.WKTool/VideoClipWindow.xaml.cs View File

@@ -46,7 +46,7 @@ namespace XHWK.WKTool
46 46
                     QS_Movie.Height = GridMovie.ActualWidth * Prop;
47 47
                     QS_Movie.Width = GridMovie.ActualWidth;
48 48
                 }
49
-                DataContext = APP.pageData;
49
+                DataContext = APP.PageContextData;
50 50
             }
51 51
             else
52 52
             {

+ 42
- 42
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

@@ -706,9 +706,10 @@
706 706
                                     <Grid.RowDefinitions>
707 707
                                         <RowDefinition Height="200*"/>
708 708
                                         <RowDefinition Height="160*"/>
709
-                                        <RowDefinition Height="305*"/>
709
+                                        <RowDefinition Height="100*"/>
710 710
                                         <RowDefinition Height="200*"/>
711 711
                                         <RowDefinition Height="90*"/>
712
+                                        <RowDefinition Height="205*"/>
712 713
                                     </Grid.RowDefinitions>
713 714
                                     <!--更换皮肤 h200-->
714 715
                                     <Grid Grid.Row="0" Margin="100,0">
@@ -860,58 +861,57 @@
860 861
                                             <Grid.RowDefinitions>
861 862
                                                 <RowDefinition Height="20*"/>
862 863
                                                 <RowDefinition Height="60*"/>
863
-                                                <RowDefinition Height="60*"/>
864
-                                                <RowDefinition Height="60*"/>
865
-                                                <RowDefinition Height="60*"/>
866 864
                                                 <RowDefinition Height="20*"/>
867 865
                                             </Grid.RowDefinitions>
868
-                                            <Grid Grid.Row="1" Grid.Column="0">
869
-                                                <!--接口地址-->
870
-                                                <TextBlock Text="接口地址" FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
871
-                                            </Grid>
872
-                                            <Grid Grid.Row="1" Grid.Column="1">
873
-                                                <Grid.ColumnDefinitions>
874
-                                                    <ColumnDefinition Width="90*"/>
875
-                                                    <ColumnDefinition Width="341*"/>
876
-                                                </Grid.ColumnDefinitions>
877
-                                                <TextBlock Grid.Column="0" Text="http://" FontSize="{Binding WordSize18}" VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
878
-                                                <TextBox Grid.Column="1" x:Name="txbInterfaceAddress" FontSize="{Binding WordSize18}" Margin="0,20"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
879
-                                            </Grid>
880
-                                            <Grid Grid.Row="2" Grid.Column="0">
881
-                                                <!--上传地址-->
882
-                                                <TextBlock Text="上传地址" FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
883
-                                            </Grid>
884
-                                            <Grid Grid.Row="2" Grid.Column="1">
885
-                                                <Grid.ColumnDefinitions>
886
-                                                    <ColumnDefinition Width="90*"/>
887
-                                                    <ColumnDefinition Width="341*"/>
888
-                                                </Grid.ColumnDefinitions>
889
-                                                <TextBlock Grid.Column="0" Text="http://" FontSize="{Binding WordSize18}" VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
890
-                                                <TextBox Grid.Column="1" x:Name="txbImageUploadAddress" FontSize="{Binding WordSize18}" Margin="0,20"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
891
-                                            </Grid>
892
-                                            <Grid Grid.Row="3" Grid.Column="0">
893
-                                                <!--下载地址-->
894
-                                                <TextBlock Text="下载地址" FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
895
-                                            </Grid>
896
-                                            <Grid Grid.Row="3" Grid.Column="1">
897
-                                                <Grid.ColumnDefinitions>
898
-                                                    <ColumnDefinition Width="90*"/>
899
-                                                    <ColumnDefinition Width="341*"/>
900
-                                                </Grid.ColumnDefinitions>
901
-                                                <TextBlock Grid.Column="0" Text="http://" FontSize="{Binding WordSize18}"  VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
902
-                                                <TextBox Grid.Column="1" x:Name="txbPictureShowsAddress" FontSize="{Binding WordSize18}" Margin="0,20"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
866
+                                            <!--地址 废弃2021年7月9日赵耀-->
867
+                                            <Grid Visibility="Collapsed">
868
+                                                <!--
869
+                                                <Grid Grid.Row="1" Grid.Column="0">
870
+                                                    <TextBlock Text="接口地址" FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
871
+                                                </Grid>
872
+                                                <Grid Grid.Row="1" Grid.Column="1">
873
+                                                    <Grid.ColumnDefinitions>
874
+                                                        <ColumnDefinition Width="90*"/>
875
+                                                        <ColumnDefinition Width="341*"/>
876
+                                                    </Grid.ColumnDefinitions>
877
+                                                    <TextBlock Grid.Column="0" Text="http://" FontSize="{Binding WordSize18}" VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
878
+                                                    <TextBox Grid.Column="1" x:Name="txbInterfaceAddress" FontSize="{Binding WordSize18}" Margin="0,20"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
879
+                                                </Grid>
880
+                                                <Grid Grid.Row="2" Grid.Column="0">
881
+                                                    <TextBlock Text="上传地址" FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
882
+                                                </Grid>
883
+                                                <Grid Grid.Row="2" Grid.Column="1">
884
+                                                    <Grid.ColumnDefinitions>
885
+                                                        <ColumnDefinition Width="90*"/>
886
+                                                        <ColumnDefinition Width="341*"/>
887
+                                                    </Grid.ColumnDefinitions>
888
+                                                    <TextBlock Grid.Column="0" Text="http://" FontSize="{Binding WordSize18}" VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
889
+                                                    <TextBox Grid.Column="1" x:Name="txbImageUploadAddress" FontSize="{Binding WordSize18}" Margin="0,20"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
890
+                                                </Grid>
891
+                                                <Grid Grid.Row="3" Grid.Column="0">
892
+                                                    <TextBlock Text="下载地址" FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
893
+                                                </Grid>
894
+                                                <Grid Grid.Row="3" Grid.Column="1">
895
+                                                    <Grid.ColumnDefinitions>
896
+                                                        <ColumnDefinition Width="90*"/>
897
+                                                        <ColumnDefinition Width="341*"/>
898
+                                                    </Grid.ColumnDefinitions>
899
+                                                    <TextBlock Grid.Column="0" Text="http://" FontSize="{Binding WordSize18}"  VerticalAlignment="Center" Margin="15,0,0,0" HorizontalAlignment="Left"/>
900
+                                                    <TextBox Grid.Column="1" x:Name="txbPictureShowsAddress" FontSize="{Binding WordSize18}" Margin="0,20"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
901
+                                                </Grid>
902
+                                                -->
903 903
                                             </Grid>
904
-                                            <Grid Grid.Row="4" Grid.Column="0">
904
+                                            <Grid Grid.Row="1" Grid.Column="0">
905 905
                                                 <TextBlock Text="文件路径"  FontSize="{Binding WordSize18}" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0" VerticalAlignment="Center"/>
906 906
                                             </Grid>
907
-                                            <Grid Grid.Row="4" Grid.Column="1">
907
+                                            <Grid Grid.Row="1" Grid.Column="1">
908 908
                                                 <Grid Margin="20,17,10,17">
909 909
                                                     <Border CornerRadius="1" BorderThickness="1" BorderBrush="#FFE3E3E3" >
910 910
                                                         <Label x:Name="txbStoragePath" Background="#FFFFFF" Margin="10,0" Content="D:\" FontSize="{Binding WordSize14}" Foreground="#333333" BorderBrush="{x:Null}" BorderThickness="0"/>
911 911
                                                     </Border>
912 912
                                                 </Grid>
913 913
                                             </Grid>
914
-                                            <Grid Grid.Row="4" Grid.Column="2">
914
+                                            <Grid Grid.Row="1" Grid.Column="2">
915 915
                                                 <Grid.ColumnDefinitions>
916 916
                                                     <ColumnDefinition Width="100*"/>
917 917
                                                     <ColumnDefinition Width="100*"/>

+ 299
- 277
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
File diff suppressed because it is too large
View File


+ 51
- 0
打包脚本/Inno Setup智慧校园.iss View File

@@ -0,0 +1,51 @@
1
+; 脚本由 Inno Setup 脚本向导 生成!
2
+; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
3
+
4
+#define MyAppName "星火智慧校园"
5
+#define MyAppVerName "星火智慧校园 v2.5.43"
6
+#define MyAppPublisher "星火燎原"
7
+#define MyAppURL "http://www.xhkjedu.com/"
8
+#define MyAppExeName "xhschool.exe"
9
+
10
+[Setup]
11
+; 注: AppId的值为单独标识该应用程序。
12
+; 不要为其他安装程序使用相同的AppId值。
13
+; (生成新的GUID,点击 工具|在IDE中生成GUID。)
14
+AppId={{4B39765F-5B1F-4368-8675-2A22904B835A}
15
+AppName={#MyAppName}
16
+AppVerName={#MyAppVerName}
17
+AppPublisher={#MyAppPublisher}
18
+AppPublisherURL={#MyAppURL}
19
+AppSupportURL={#MyAppURL}
20
+AppUpdatesURL={#MyAppURL}
21
+DefaultDirName=D:\xhschool
22
+DefaultGroupName={#MyAppName}
23
+AllowNoIcons=yes
24
+OutputDir=E:\安装包
25
+OutputBaseFilename=星火智慧校园V2.5.43T
26
+SetupIconFile=E:\project\schoolclient\bin\x86\Debug\favicon256.ico
27
+Compression=lzma
28
+SolidCompression=yes
29
+
30
+[Languages]
31
+Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
32
+
33
+[Tasks]
34
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
35
+Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
36
+
37
+[Files]
38
+Source: "E:\project\schoolclient\bin\x86\Debug\xhschool.exe"; DestDir: "{app}"; Flags: ignoreversion
39
+Source: "E:\project\schoolclient\bin\x86\Debug\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
40
+; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
41
+
42
+[Icons]
43
+Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
44
+Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
45
+Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
46
+Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
47
+Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
48
+
49
+[Run]
50
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent
51
+

+ 7
- 0
打包脚本/微课发包注意项.txt View File

@@ -0,0 +1,7 @@
1
+删除Data、ffmpeg、Log、Temp文件夹
2
+
3
+latticeXML为授权文件
4
+OIDPublishImageGenerator 腾千里?
5
+PrintTool 点阵打印文件
6
+Resources 资源文件
7
+SSCR 插件安装包

Loading…
Cancel
Save