Browse Source

zhao:修改FFMPEG类

tags/录制修改前
耀 4 years ago
parent
commit
9d5379f4b9

+ 132
- 31
Common/system/FFMpeg.cs View File

@@ -17,7 +17,7 @@ namespace Common.system
17 17
     /// </summary>
18 18
     public class FFMpeg
19 19
     {
20
-        Process myProcess = null;
20
+        public Process myProcess = null;
21 21
         /// <summary>
22 22
         /// ffmpeg输出日志文件地址  每个文件2MB左右
23 23
         /// </summary>
@@ -28,13 +28,16 @@ namespace Common.system
28 28
         /// <param name="FilePath">文件存储路径</param>
29 29
         public void StartRecordingVideo(string FilePath)
30 30
         {
31
+            while (myProcess != null)
32
+            {
33
+                Thread.Sleep(100);
34
+            }
31 35
             //路径
32
-            string Path = FileToolsCommon.GetDirectoryName(FilePath) + @"\";
36
+            string Path = FileToolsCommon.GetDirectoryName(FilePath);
33 37
             string Extension = FileToolsCommon.GetIOExtension(FilePath);//扩展名
34 38
             //文件保存路径
35 39
             string PathName = GetFilePathName(FilePath);
36 40
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
37
-            Debug.WriteLine(KillProcessArray.Length.ToString());
38 41
             foreach (var KillProcess in KillProcessArray)
39 42
             {
40 43
                 KillProcess.Kill();
@@ -95,8 +98,13 @@ namespace Common.system
95 98
         /// <param name="Mp3Path">MP3音频位置</param>
96 99
         public void StartRecordingAudio(string Mp3Path)
97 100
         {
101
+            while (myProcess != null)
102
+            {
103
+                Thread.Sleep(100);
104
+            }
105
+            //文件保存路径
106
+            string PathName = GetFilePathName(Mp3Path);
98 107
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
99
-            Debug.WriteLine(KillProcessArray.Length.ToString());
100 108
             foreach (var KillProcess in KillProcessArray)
101 109
             {
102 110
                 KillProcess.Kill();
@@ -107,12 +115,12 @@ namespace Common.system
107 115
             string MicrophoneName = GetMicrophone();
108 116
             if (string.IsNullOrWhiteSpace(MicrophoneName))
109 117
             {
110
-                myProcess.StartInfo.Arguments = "-f dshow -i audio=\"virtual-audio-capturer\" " + Mp3Path;
118
+                myProcess.StartInfo.Arguments = "-f dshow -i audio=\"virtual-audio-capturer\" " + PathName;
111 119
             }
112 120
             else
113 121
             {
114 122
                 myProcess.StartInfo.Arguments = "-f dshow -i audio=\"virtual-audio-capturer\"  -f dshow -i audio=\"" +
115
-                        MicrophoneName + "\" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 " + Mp3Path;
123
+                        MicrophoneName + "\" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 " + PathName;
116 124
             }
117 125
             myProcess.StartInfo.UseShellExecute = false;           //不使用操作系统外壳程序启动
118 126
             myProcess.StartInfo.RedirectStandardError = true;      //重定向标准错误输出
@@ -127,14 +135,29 @@ namespace Common.system
127 135
         /// <summary>
128 136
         /// 暂停录制
129 137
         /// </summary>
130
-        public void SuspendFFmpeg()
138
+        public bool SuspendFFmpeg()
131 139
         {
132
-            if (myProcess == null)
133
-                return;
134
-            myProcess.StandardInput.WriteLine("q");//在这个进程的控制台中模拟输入q,用于暂停录制
135
-            myProcess.Close();//关闭进程
136
-            myProcess.Dispose();//释放资源
140
+            if (myProcess != null)
141
+            {
142
+                myProcess.StandardInput.WriteLine("q");//在这个进程的控制台中模拟输入q,用于暂停录制
143
+                myProcess.Close();//关闭进程
144
+                myProcess.Dispose();//释放资源
145
+            }
146
+            #region 进程是否已经释放
147
+            bool IsRunning = true;
148
+            while (IsRunning)
149
+            {
150
+                IsRunning = false;
151
+                Process[] ProcessArray = Process.GetProcessesByName("ffmpeg");
152
+                foreach (var KillProcess in ProcessArray)
153
+                {
154
+                    IsRunning = true;
155
+                    Thread.Sleep(100);
156
+                }
157
+            }
158
+            #endregion
137 159
             myProcess = null;
160
+            return true;
138 161
             //myProcess.Kill();
139 162
         }
140 163
 
@@ -142,17 +165,32 @@ namespace Common.system
142 165
         /// 停止录制并合成文件
143 166
         /// </summary>
144 167
         /// <param name="FilePath">文件存储路径 必须与开始时的路径完全一致</param>
145
-        public void StopFFmpeg(string FilePath)
168
+        public bool StopFFmpeg(string FilePath)
146 169
         {
147 170
             //文件完整路径
148
-            if (myProcess == null)
149
-                return;
150
-            myProcess.StandardInput.WriteLine("q");//在这个进程的控制台中模拟输入q,用于暂停录制
151
-            myProcess.Close();//关闭进程
152
-            myProcess.Dispose();//释放资源
171
+            if (myProcess != null)
172
+            {
173
+                myProcess.StandardInput.WriteLine("q");//在这个进程的控制台中模拟输入q,用于暂停录制
174
+                myProcess.Close();//关闭进程
175
+                myProcess.Dispose();//释放资源
176
+            }
177
+            #region 进程是否已经释放
178
+            bool IsRunning = true;
179
+            while (IsRunning)
180
+            {
181
+                IsRunning = false;
182
+                Process[] ProcessArray = Process.GetProcessesByName("ffmpeg");
183
+                foreach (var KillProcess in ProcessArray)
184
+                {
185
+                    IsRunning = true;
186
+                    Thread.Sleep(100);
187
+                }
188
+            }
189
+            #endregion
153 190
             myProcess = null;
154 191
             Thread t1 = new Thread(MergeVideoOrAudio);
155 192
             t1.Start(FilePath);
193
+            return true;
156 194
             //文件合成
157 195
         }
158 196
 
@@ -167,14 +205,16 @@ namespace Common.system
167 205
         /// <param name="VideoHeight">视频高度</param>
168 206
         public void SynthesisVideo(string ImageListPath, string Mp3Path, string VideoSavePath, int Frequency, int VideoWidth, int VideoHeight)
169 207
         {
170
-            Thread thread = new Thread(delegate ()
208
+            new Thread(new ThreadStart(new Action(() =>
171 209
             {
172
-                //// 允许不同线程间的调用
173
-                //Control.CheckForIllegalCrossThreadCalls = false;
174 210
                 Thread.Sleep(500);
211
+                while (myProcess != null)
212
+                {
213
+                    Thread.Sleep(100);
214
+                }
175 215
                 string Extension = FileToolsCommon.GetIOExtension(VideoSavePath);//扩展名
176 216
                 Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
177
-                Debug.WriteLine(KillProcessArray.Length.ToString());
217
+                //Debug.WriteLine(KillProcessArray.Length.ToString());
178 218
                 foreach (var KillProcess in KillProcessArray)
179 219
                 {
180 220
                     KillProcess.Kill();
@@ -220,23 +260,53 @@ namespace Common.system
220 260
                 myProcess.WaitForExit();           //阻塞等待进程结束
221 261
                 myProcess.Close();                 //关闭进程
222 262
                 myProcess.Dispose();               //释放资源
223
-                                                   //生成视频后删除图片保存列表
224
-                FileToolsCommon.DeleteDirectory(ImageListPath);
225
-            });
263
+                #region 进程是否已经释放
264
+                bool IsRunning = true;
265
+                while (IsRunning)
266
+                {
267
+                    IsRunning = false;
268
+                    Process[] ProcessArray = Process.GetProcessesByName("ffmpeg");
269
+                    foreach (var KillProcess in ProcessArray)
270
+                    {
271
+                        IsRunning = true;
272
+                        Thread.Sleep(100);
273
+                    }
274
+                }
275
+                #endregion
276
+                myProcess = null;
277
+                //生成视频后删除图片和音频保存列表
278
+                //FileToolsCommon.DeleteDirectory(ImageListPath);
279
+                //FileToolsCommon.DeleteDirectory(FileToolsCommon.GetDirectoryName(Mp3Path));
280
+
281
+                //Dispatcher.Invoke(() =>
282
+                //{
283
+                //});
284
+                //// 允许不同线程间的调用
285
+                //Control.CheckForIllegalCrossThreadCalls = false;
286
+            }))).Start();
226 287
         }
227 288
 
228 289
         /// <summary>
229 290
         /// 视频音频合成
230 291
         /// </summary>
231 292
         /// <param name="FilePath">存储路径</param>
232
-        void MergeVideoOrAudio(object FilePathobj)
293
+        public void MergeVideoOrAudio(object FilePathobj)
233 294
         {
234
-            Thread.Sleep(500);
295
+            //new Thread(new ThreadStart(new Action(() =>
296
+            //{
297
+            //Dispatcher.Invoke(() =>
298
+            //{
299
+            //});
300
+            //}))).Start();
301
+
302
+            while (myProcess != null)
303
+            {
304
+                Thread.Sleep(100);
305
+            }
235 306
             //路径
236 307
             string FilePath = (string)FilePathobj;
237
-            string Path = FileToolsCommon.GetDirectoryName(FilePath) + @"\";
308
+            string Path = FileToolsCommon.GetDirectoryName(FilePath);
238 309
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
239
-            Debug.WriteLine(KillProcessArray.Length.ToString());
240 310
             foreach (var KillProcess in KillProcessArray)
241 311
             {
242 312
                 KillProcess.Kill();
@@ -256,6 +326,20 @@ namespace Common.system
256 326
             myProcess.WaitForExit();           //阻塞等待进程结束
257 327
             myProcess.Close();                 //关闭进程
258 328
             myProcess.Dispose();               //释放资源
329
+            #region 进程是否已经释放
330
+            bool IsRunning = true;
331
+            while (IsRunning)
332
+            {
333
+                IsRunning = false;
334
+                Process[] ProcessArray = Process.GetProcessesByName("ffmpeg");
335
+                foreach (var KillProcess in ProcessArray)
336
+                {
337
+                    IsRunning = true;
338
+                    Thread.Sleep(100);
339
+                }
340
+            }
341
+            #endregion
342
+            myProcess = null;
259 343
         }
260 344
 
261 345
         /// <summary>
@@ -266,7 +350,7 @@ namespace Common.system
266 350
         string GetFilePathName(string FilePath)
267 351
         {
268 352
             //路径
269
-            string Path = FileToolsCommon.GetDirectoryName(FilePath) + @"\";
353
+            string Path = FileToolsCommon.GetDirectoryName(FilePath);
270 354
             //Path.GetFileName(FilePath);//获取文件名
271 355
             string Extension = FileToolsCommon.GetIOExtension(FilePath);//扩展名
272 356
             string tempFilePath = Path + "temp/";
@@ -295,8 +379,11 @@ namespace Common.system
295 379
         /// <param name="ImagePath">图片地址</param>
296 380
         public void GenerateThumbnails(string VideoPath, string ImagePath)
297 381
         {
382
+            while (myProcess != null)
383
+            {
384
+                Thread.Sleep(100);
385
+            }
298 386
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
299
-            Debug.WriteLine(KillProcessArray.Length.ToString());
300 387
             foreach (var KillProcess in KillProcessArray)
301 388
             {
302 389
                 KillProcess.Kill();
@@ -317,6 +404,20 @@ namespace Common.system
317 404
             myProcess.WaitForExit();           //阻塞等待进程结束
318 405
             myProcess.Close();                 //关闭进程
319 406
             myProcess.Dispose();               //释放资源
407
+            #region 进程是否已经释放
408
+            bool IsRunning = true;
409
+            while (IsRunning)
410
+            {
411
+                IsRunning = false;
412
+                Process[] ProcessArray = Process.GetProcessesByName("ffmpeg");
413
+                foreach (var KillProcess in ProcessArray)
414
+                {
415
+                    IsRunning = true;
416
+                    Thread.Sleep(100);
417
+                }
418
+            }
419
+            #endregion
420
+            myProcess = null;
320 421
         }
321 422
 
322 423
         /// <summary>

+ 2
- 1
Common/system/FileToolsCommon.cs View File

@@ -70,6 +70,7 @@ namespace Common.system
70 70
             ErrMessage = "";
71 71
             try
72 72
             {
73
+                FilePathName = GetLegalPath(FilePathName);
73 74
                 FilePath = GetDirectoryName(FilePathName);
74 75
                 FileName = GetIOFileName(FilePathName);
75 76
             }
@@ -671,7 +672,7 @@ namespace Common.system
671 672
         /// <param name="filePath">文件的绝对路径</param>          
672 673
         public static string GetDirectoryName(string filePath)
673 674
         {
674
-            string DirectoryName = (System.IO.Path.GetDirectoryName(filePath) + "\\").Replace("\\", "/");
675
+            string DirectoryName = (System.IO.Path.GetDirectoryName(filePath+ "\\") ).Replace("\\", "/");
675 676
             return DirectoryName;
676 677
         }
677 678
         #endregion

+ 40
- 41
Common/system/ImageHelper.cs View File

@@ -85,44 +85,44 @@ namespace Common.system
85 85
         /// <returns></returns>
86 86
         public static BitmapImage GetScreenshot(Rectangle ScreenSize, string ImageSavePath, long level = -1)
87 87
         {
88
-            try
89
-            {
90
-                System.Drawing.Size bounds = PrimaryScreen.DESKTOP;
91
-                //if (string.IsNullOrEmpty(ImageSavePath))
92
-                //{
93
-                //    ImageSavePath = GetTempImagePath();//如果为空则指定临时存储路径
94
-                //}
95
-                double scaleWidth = (bounds.Width * 1.0) / SystemParameters.PrimaryScreenWidth;
96
-                double scaleHeight = (bounds.Height * 1.0) / SystemParameters.PrimaryScreenHeight;
97
-                int width = bounds.Width;
98
-                int height = bounds.Height;
99
-                if (ScreenSize.Size != new System.Drawing.Size(0, 0))
100
-                {
101
-                    width = (int)(ScreenSize.Size.Width * scaleWidth);
102
-                    height = (int)(ScreenSize.Size.Height * scaleHeight);
103
-                }
104
-                int l = (int)(ScreenSize.X * scaleWidth);
105
-                int t = (int)(ScreenSize.Y * scaleHeight);
106
-                //if (_Bitmap != null)
107
-                //{
108
-                //    _Bitmap.Dispose();
109
-                //}
110
-                Bitmap _Bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
111
-                using (Graphics g = Graphics.FromImage(_Bitmap))
112
-                {
113
-                    g.CopyFromScreen(l, t, 0, 0, _Bitmap.Size, CopyPixelOperation.SourceCopy);
114
-                    Compress(_Bitmap, ImageSavePath, level);
115
-                }
116
-                Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
117
-                BitmapImage bimg = new BitmapImage(uri);
118
-                GC.Collect();
119
-                return bimg;
120
-            }
121
-            catch (Exception ex)
122
-            {
123
-                LogHelper.WriteErrLog("【截图】(GetBitmapSource)截图失败," + ex.Message, ex);
124
-                return null;
125
-            }
88
+            //try
89
+            //{
90
+            //    System.Drawing.Size bounds = PrimaryScreen.DESKTOP;
91
+            //    //if (string.IsNullOrEmpty(ImageSavePath))
92
+            //    //{
93
+            //    //    ImageSavePath = GetTempImagePath();//如果为空则指定临时存储路径
94
+            //    //}
95
+            //    double scaleWidth = (bounds.Width * 1.0) / SystemParameters.PrimaryScreenWidth;
96
+            //    double scaleHeight = (bounds.Height * 1.0) / SystemParameters.PrimaryScreenHeight;
97
+            //    int width = bounds.Width;
98
+            //    int height = bounds.Height;
99
+            //    if (ScreenSize.Size != new System.Drawing.Size(0, 0))
100
+            //    {
101
+            //        width = (int)(ScreenSize.Size.Width * scaleWidth);
102
+            //        height = (int)(ScreenSize.Size.Height * scaleHeight);
103
+            //    }
104
+            //    int l = (int)(ScreenSize.X * scaleWidth);
105
+            //    int t = (int)(ScreenSize.Y * scaleHeight);
106
+            //    //if (_Bitmap != null)
107
+            //    //{
108
+            //    //    _Bitmap.Dispose();
109
+            //    //}
110
+            //    Bitmap _Bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
111
+            //    using (Graphics g = Graphics.FromImage(_Bitmap))
112
+            //    {
113
+            //        g.CopyFromScreen(l, t, 0, 0, _Bitmap.Size, CopyPixelOperation.SourceCopy);
114
+            //        Compress(_Bitmap, ImageSavePath, level);
115
+            //    }
116
+            //    Uri uri = new Uri(ImageSavePath, UriKind.Absolute);
117
+            //    BitmapImage bimg = new BitmapImage(uri);
118
+            //    GC.Collect();
119
+            //    return bimg;
120
+            //}
121
+            //catch (Exception ex)
122
+            //{
123
+            //    //LogHelper.WriteErrLog("【截图】(GetBitmapSource)截图失败," + ex.Message, ex);
124
+            return null;
125
+            //}
126 126
         }
127 127
 
128 128
         //private static Bitmap _Bitmap = null;
@@ -164,7 +164,7 @@ namespace Common.system
164 164
         {
165 165
             if (level <= -1)
166 166
             {
167
-                int ImageCompressionLevel = int.Parse(ConfigurationManager.AppSettings["ImageCompressionLevel"]);
167
+                int ImageCompressionLevel = int.Parse(FileToolsCommon.GetConfigValue("ImageCompressionLevel"));
168 168
                 level = ImageCompressionLevel;
169 169
             }
170 170
             Stream s = new FileStream(destFile, FileMode.Create);
@@ -336,7 +336,6 @@ namespace Common.system
336 336
         #endregion 图片压缩
337 337
 
338 338
         #region 截屏指定UI控件
339
-
340 339
         /// <summary>
341 340
         /// 保存图片
342 341
         /// </summary>
@@ -344,7 +343,7 @@ namespace Common.system
344 343
         /// <param name="filePathName">图片保存地址 命名 1.png</param>
345 344
         /// <param name="width">保存宽</param>
346 345
         /// <param name="height">保存高</param>
347
-        private void SaveUIToImage(FrameworkElement ui, string filePathName, int width, int height)
346
+        public static void SaveUIToImage(FrameworkElement ui, string filePathName, int width, int height)
348 347
         {
349 348
             try
350 349
             {

+ 2
- 0
XHWK.WKTool/App.config View File

@@ -10,5 +10,7 @@
10 10
     <add key="VideoSavePath" value="D:\星火微课" />
11 11
     <!--视频格式 1、MP4 2、FlV 3、AVI-->
12 12
     <add key="VideoType" value="1" />
13
+    <!--图片压缩质量-->
14
+    <add key="ImageCompressionLevel" value="50"/>
13 15
   </appSettings>
14 16
 </configuration>

+ 5
- 5
XHWK.WKTool/CreateAMicroLessonWindow.xaml View File

@@ -22,7 +22,7 @@
22 22
             <Border Grid.Row="0" Background="#2D8CF0">
23 23
                 <Grid>
24 24
                     <TextBlock Text="创建微课" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
25
-                    <Button Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
25
+                    <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
26 26
                 </Grid>
27 27
             </Border>
28 28
             <!--第二行 讲解名称-->
@@ -31,7 +31,7 @@
31 31
                 <TextBlock Text="讲解名称" FontSize="18" Padding="2,15,10,0"/>
32 32
                 <!--输入框-->
33 33
                 <Border Background="#CDD6E0" Width="321" Height="43" CornerRadius="3">
34
-                    <TextBox x:Name="txbExplainName" Text="" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="319" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
34
+                    <TextBox x:Name="txbExplainName" Text="微课1" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="319" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
35 35
                 </Border>
36 36
             </StackPanel>
37 37
             <!--第三行 存放路径-->
@@ -40,10 +40,10 @@
40 40
                 <TextBlock Text="存放路径" FontSize="18" Padding="2,15,10,0"/>
41 41
                 <!--输入框-->
42 42
                 <Border Background="#CDD6E0" Width="225" Height="43" CornerRadius="3">
43
-                    <TextBox x:Name="txbStoragePath" Text="D:\星火微课" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="223" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
43
+                    <TextBox x:Name="txbStoragePath" Text="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="223" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
44 44
                 </Border>
45 45
                 <!--浏览按钮-->
46
-                <Button x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
46
+                <Button  Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
47 47
                     <Button.Template>
48 48
                         <ControlTemplate TargetType="{x:Type Button}">
49 49
                             <Border
@@ -61,7 +61,7 @@
61 61
                 </Button>
62 62
             </StackPanel>
63 63
             <!--第四行 开始按钮-->
64
-            <Button Grid.Row="3" x:Name="btnStart" Content="开始" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
64
+            <Button  Cursor="Hand" Grid.Row="3" x:Name="btnStart" Content="开始" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
65 65
                 <Button.Template>
66 66
                     <ControlTemplate TargetType="{x:Type Button}">
67 67
                         <Border

+ 6
- 5
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

@@ -34,7 +34,7 @@ namespace XHWK.WKTool
34 34
         /// <param name="e"></param>
35 35
         private void BtnDown_Click(object sender, RoutedEventArgs e)
36 36
         {
37
-
37
+            System.Environment.Exit(0);
38 38
         }
39 39
         /// <summary>
40 40
         /// 浏览
@@ -76,10 +76,11 @@ namespace XHWK.WKTool
76 76
                 System.Windows.MessageBox.Show("路径不可为空!");
77 77
                 return;
78 78
             }
79
-            if (!FileToolsCommon.IsLegalPath(txbExplainName.Text.Trim(), out string ErrMessage))
80
-            {
81
-                System.Windows.MessageBox.Show(ErrMessage);
82
-            }
79
+            //if (!FileToolsCommon.IsLegalPath(txbStoragePath.Text.Trim(), out string ErrMessage))
80
+            //{
81
+            //    System.Windows.MessageBox.Show(ErrMessage);
82
+            //    return;
83
+            //}
83 84
             string PathName = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + txbExplainName.Text.Trim() + "/";
84 85
             if (FileToolsCommon.IsExistDirectory(PathName))
85 86
             {

+ 3
- 3
XHWK.WKTool/FileDirectoryWindow.xaml View File

@@ -21,7 +21,7 @@
21 21
             <Border Grid.Row="0" Background="#2D8CF0">
22 22
                 <Grid  MouseLeftButtonDown="Window_MouseLeftButtonDown">
23 23
                     <TextBlock Text="文件目录" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
24
-                    <Button Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnDown_Click"/>
24
+                    <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnDown_Click"/>
25 25
                 </Grid>
26 26
             </Border>
27 27
            <!--第二行 内容-->
@@ -30,7 +30,7 @@
30 30
             </Grid>
31 31
             <!--第三行 删除 上传 按钮-->
32 32
             <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center">
33
-                <Button x:Name="btnDelete" Content="删除" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="0,0,30,0">
33
+                <Button  Cursor="Hand" x:Name="btnDelete" Content="删除" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="0,0,30,0">
34 34
                     <Button.Template>
35 35
                         <ControlTemplate TargetType="{x:Type Button}">
36 36
                             <Border
@@ -46,7 +46,7 @@
46 46
                         </ControlTemplate>
47 47
                     </Button.Template>
48 48
                 </Button>
49
-                <Button x:Name="btnUpload" Content="上传" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="30,0,0,0">
49
+                <Button  Cursor="Hand" x:Name="btnUpload" Content="上传" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="30,0,0,0">
50 50
                     <Button.Template>
51 51
                         <ControlTemplate TargetType="{x:Type Button}">
52 52
                             <Border

+ 3
- 3
XHWK.WKTool/LoginWindow.xaml View File

@@ -23,7 +23,7 @@
23 23
             <Border Grid.Row="0" Background="#2D8CF0">
24 24
                 <Grid>
25 25
                     <TextBlock Text="登录星火微课系统" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
26
-                    <Button Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
26
+                    <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
27 27
                 </Grid>
28 28
             </Border>
29 29
             <!--第二行 登陆 账号-->
@@ -43,7 +43,7 @@
43 43
                 </Border>
44 44
             </StackPanel>
45 45
             <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20,0,0,0">
46
-                <Button Grid.Row="3" Height="20" Width="20" Content="√" FontSize="13" >
46
+                <Button  Cursor="Hand" Grid.Row="3" Height="20" Width="20" Content="√" FontSize="13" >
47 47
                     <Button.Template>
48 48
                         <ControlTemplate TargetType="{x:Type Button}">
49 49
                             <Border
@@ -63,7 +63,7 @@
63 63
             </StackPanel>
64 64
             
65 65
             <!--第五行 开始按钮-->
66
-            <Button Grid.Row="4" x:Name="btnStart" Content="登录" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
66
+            <Button  Cursor="Hand" Grid.Row="4" x:Name="btnStart" Content="登录" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
67 67
                 <Button.Template>
68 68
                     <ControlTemplate TargetType="{x:Type Button}">
69 69
                         <Border

Loading…
Cancel
Save