|
@@ -13,6 +13,7 @@ using System.Drawing;
|
13
|
13
|
using System.Drawing.Imaging;
|
14
|
14
|
using System.IO;
|
15
|
15
|
using System.Linq;
|
|
16
|
+using System.Text;
|
16
|
17
|
using System.Threading;
|
17
|
18
|
using System.Windows;
|
18
|
19
|
using System.Windows.Controls;
|
|
@@ -119,7 +120,20 @@ namespace XHWK.WKTool
|
119
|
120
|
GridContent.Height = Height;
|
120
|
121
|
|
121
|
122
|
|
122
|
|
-
|
|
123
|
+ #region 读取本地配置
|
|
124
|
+ if (File.Exists(APP.dataPath + "interfaceAddress.txt")) //若不为空
|
|
125
|
+ {
|
|
126
|
+ APP.apiUrl = System.IO.File.ReadAllText(APP.dataPath + "interfaceAddress.txt", Encoding.Default);
|
|
127
|
+ }
|
|
128
|
+ if (File.Exists(APP.dataPath + "imageUploadAddress.txt")) //若不为空
|
|
129
|
+ {
|
|
130
|
+ APP.uploadUrl = System.IO.File.ReadAllText(APP.dataPath + "imageUploadAddress.txt", Encoding.Default);
|
|
131
|
+ }
|
|
132
|
+ if (File.Exists(APP.dataPath + "pictureShowsAddress.txt")) //若不为空
|
|
133
|
+ {
|
|
134
|
+ APP.showImageUrl = System.IO.File.ReadAllText(APP.dataPath + "pictureShowsAddress.txt", Encoding.Default);
|
|
135
|
+ }
|
|
136
|
+ #endregion
|
123
|
137
|
|
124
|
138
|
//GridMain.Height= PrimaryScreen.ScaleScreenSize().Height - 40;
|
125
|
139
|
|
|
@@ -451,6 +465,39 @@ namespace XHWK.WKTool
|
451
|
465
|
//ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
|
452
|
466
|
//ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
|
453
|
467
|
//BtnRecord.IsEnabled = false;//设置时不可录制
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+ #region 读取用户配置
|
|
472
|
+ //接口地址
|
|
473
|
+ if (!File.Exists(APP.dataPath + "interfaceAddress.txt")) //若为空
|
|
474
|
+ {
|
|
475
|
+ txbInterfaceAddress.Text = APP.apiUrl.Replace("http://", "").Trim();
|
|
476
|
+ }
|
|
477
|
+ else
|
|
478
|
+ {
|
|
479
|
+ txbInterfaceAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "interfaceAddress.txt", Encoding.Default).Replace("http://", "").Trim();
|
|
480
|
+ }
|
|
481
|
+ //上传地址
|
|
482
|
+ if (!File.Exists(APP.dataPath + "imageUploadAddress.txt")) //若为空
|
|
483
|
+ {
|
|
484
|
+ txbImageUploadAddress.Text = APP.uploadUrl.Replace("http://", "").Replace("/", "").Trim();
|
|
485
|
+ }
|
|
486
|
+ else
|
|
487
|
+ {
|
|
488
|
+ txbImageUploadAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "imageUploadAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Trim();
|
|
489
|
+ }
|
|
490
|
+ //下载地址
|
|
491
|
+ if (!File.Exists(APP.dataPath + "pictureShowsAddress.txt")) //若为空
|
|
492
|
+ {
|
|
493
|
+ txbPictureShowsAddress.Text = APP.showImageUrl.Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
|
|
494
|
+ }
|
|
495
|
+ else
|
|
496
|
+ {
|
|
497
|
+ txbPictureShowsAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "pictureShowsAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
|
|
498
|
+ }
|
|
499
|
+
|
|
500
|
+
|
454
|
501
|
/// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
|
455
|
502
|
if ("1".Equals(APP.CameraPosition))
|
456
|
503
|
{
|
|
@@ -490,6 +537,7 @@ namespace XHWK.WKTool
|
490
|
537
|
{
|
491
|
538
|
rbnN.IsChecked = true;
|
492
|
539
|
}
|
|
540
|
+ #endregion
|
493
|
541
|
}
|
494
|
542
|
}
|
495
|
543
|
/// <summary>
|
|
@@ -530,6 +578,53 @@ namespace XHWK.WKTool
|
530
|
578
|
ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
|
531
|
579
|
ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
|
532
|
580
|
BtnRecord.IsEnabled = true;//设置结束时可录制
|
|
581
|
+
|
|
582
|
+ if (!string.IsNullOrWhiteSpace(txbInterfaceAddress.Text))
|
|
583
|
+ {
|
|
584
|
+ string ApplicationData = APP.dataPath + "interfaceAddress.txt";
|
|
585
|
+ string temp = "http://" + txbInterfaceAddress.Text;
|
|
586
|
+ System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
587
|
+ }
|
|
588
|
+ else
|
|
589
|
+ {
|
|
590
|
+ MessageWindow.Show("接口地址未输入");
|
|
591
|
+ return;
|
|
592
|
+ }
|
|
593
|
+ if (!string.IsNullOrWhiteSpace(txbImageUploadAddress.Text))//图片上传地址
|
|
594
|
+ {
|
|
595
|
+ string ApplicationData = APP.dataPath + "imageUploadAddress.txt";
|
|
596
|
+ string temp = "http://" + txbImageUploadAddress.Text + "/";
|
|
597
|
+ System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
598
|
+ }
|
|
599
|
+ else
|
|
600
|
+ {
|
|
601
|
+ MessageWindow.Show("上传地址未输入");
|
|
602
|
+ return;
|
|
603
|
+ }
|
|
604
|
+ if (!string.IsNullOrWhiteSpace(txbPictureShowsAddress.Text))
|
|
605
|
+ {
|
|
606
|
+ string ApplicationData = APP.dataPath + "pictureShowsAddress.txt";
|
|
607
|
+ string temp = "http://" + txbPictureShowsAddress.Text + "/static/";
|
|
608
|
+ System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
609
|
+ }
|
|
610
|
+ else
|
|
611
|
+ {
|
|
612
|
+ MessageWindow.Show("下载地址未输入");
|
|
613
|
+ return;
|
|
614
|
+ }
|
|
615
|
+ if (!APP.apiUrl.Equals(txbInterfaceAddress.Text))
|
|
616
|
+ {
|
|
617
|
+ APP.apiUrl = "http://" + txbInterfaceAddress.Text;
|
|
618
|
+ LoginType();
|
|
619
|
+ }
|
|
620
|
+ if (!APP.uploadUrl.Equals(txbImageUploadAddress.Text))
|
|
621
|
+ {
|
|
622
|
+ APP.uploadUrl = "http://" + txbImageUploadAddress.Text + "/";
|
|
623
|
+ }
|
|
624
|
+ if (!APP.showImageUrl.Equals(txbPictureShowsAddress.Text))
|
|
625
|
+ {
|
|
626
|
+ APP.showImageUrl = "http://" + txbPictureShowsAddress.Text + "/static/";
|
|
627
|
+ }
|
533
|
628
|
if (rbnMP4.IsChecked == true)
|
534
|
629
|
{
|
535
|
630
|
//存储文件
|
|
@@ -592,7 +687,7 @@ namespace XHWK.WKTool
|
592
|
687
|
{
|
593
|
688
|
//存储文件
|
594
|
689
|
FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
|
595
|
|
- System.Windows.MessageBox.Show("路径已变更,下次创建微课时自动生效!!!");
|
|
690
|
+ MessageWindow.Show("路径已变更,下次创建微课时自动生效!!!");
|
596
|
691
|
}
|
597
|
692
|
}
|
598
|
693
|
/// <summary>
|
|
@@ -1154,6 +1249,7 @@ namespace XHWK.WKTool
|
1154
|
1249
|
public void InitializeUpload()
|
1155
|
1250
|
{
|
1156
|
1251
|
APP.myloading.Show();
|
|
1252
|
+
|
1157
|
1253
|
MouseNumber = 0;
|
1158
|
1254
|
IsModify = false;
|
1159
|
1255
|
//加载视频列表
|
|
@@ -1319,11 +1415,6 @@ namespace XHWK.WKTool
|
1319
|
1415
|
|
1320
|
1416
|
if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
|
1321
|
1417
|
{
|
1322
|
|
- pageData.menuList[i].Visi = "Collapsed";
|
1323
|
|
- pageData.menuList[i].Coll = "Visible";
|
1324
|
|
-
|
1325
|
|
- DataContext = pageData;
|
1326
|
|
-
|
1327
|
1418
|
//MessageWindow.Show("视频上传服务器成功!");
|
1328
|
1419
|
if (APP.W_UploadWindow == null)
|
1329
|
1420
|
{
|
|
@@ -1335,6 +1426,10 @@ namespace XHWK.WKTool
|
1335
|
1426
|
//long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
|
1336
|
1427
|
APP.W_UploadWindow.Initialize(pageData.menuList[i].VideoName, pageData.menuList[i].VideoSizes, pageData.menuList[i].VideoType, pageData.menuList[i].FileGuid);
|
1337
|
1428
|
APP.W_UploadWindow.ShowDialog();
|
|
1429
|
+ pageData.menuList[i].Visi = "Collapsed";
|
|
1430
|
+ pageData.menuList[i].Coll = "Visible";
|
|
1431
|
+
|
|
1432
|
+ DataContext = pageData;
|
1338
|
1433
|
|
1339
|
1434
|
}
|
1340
|
1435
|
else
|
|
@@ -2441,6 +2536,17 @@ namespace XHWK.WKTool
|
2441
|
2536
|
}
|
2442
|
2537
|
}
|
2443
|
2538
|
/// <summary>
|
|
2539
|
+ /// 状态更改为未登陆
|
|
2540
|
+ /// </summary>
|
|
2541
|
+ private void LoginType()
|
|
2542
|
+ {
|
|
2543
|
+ APP.IsLoginType = false;
|
|
2544
|
+ txbLoginType.Text = "未登录";
|
|
2545
|
+ APP.UserInfo = new Model_UserInfo();
|
|
2546
|
+ ImgUpload.Visibility = Visibility.Collapsed;
|
|
2547
|
+ ImgUploadTwo.Visibility = Visibility.Visible;
|
|
2548
|
+ }
|
|
2549
|
+ /// <summary>
|
2444
|
2550
|
/// 获取时间戳
|
2445
|
2551
|
/// </summary>
|
2446
|
2552
|
/// <returns></returns>
|