allow user to set time for OnePicAudio in General tab
[marukotoolbox.git] / mp4box / FeedbackForm.cs
blob0b501f9646eef61fd0af64717fb81e71fdb86c69
1 // ------------------------------------------------------------------
2 // Copyright (C) 2015-2016 Maruko Toolbox Project
3 //
4 // Authors: komaruchan <sandy_0308@hotmail.com>
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
15 // express or implied.
16 // See the License for the specific language governing permissions
17 // and limitations under the License.
18 // -------------------------------------------------------------------
21 using ControlExs;
22 using System;
23 using System.Collections.Generic;
24 using System.ComponentModel;
25 using System.Data;
26 using System.Drawing;
27 using System.IO;
28 using System.Linq;
29 using System.Text;
30 using System.Windows.Forms;
32 namespace mp4box
34 public partial class FeedbackForm : FormBase
36 public FeedbackForm()
38 InitializeComponent();
41 private void FeedbackForm_Load(object sender, EventArgs e)
43 string version4 = OSInfo.GetDotNetVersion("4.0");
44 string version = OSInfo.GetDotNetVersion();
45 MessageTextBox.AppendText(string.Format("小丸工具箱 版本: {0}", new Version(ProductVersion)));
46 MessageTextBox.AppendText(string.Format("\r\n操作系统: {0}{1} ({2}.{3}.{4}.{5})",
47 OSInfo.GetOSName(), OSInfo.GetOSServicePack(), OSInfo.OSMajorVersion, OSInfo.OSMinorVersion, OSInfo.OSRevisionVersion, OSInfo.OSBuildVersion));
48 if (string.IsNullOrEmpty(version4))
49 MessageTextBox.AppendText("\r\n.NET Framework 4.0 未安装");
50 else
51 MessageTextBox.AppendText(string.Format("\r\nMicrosoft .NET Framework: {0}", version4));
52 if (!string.IsNullOrEmpty(version) && !version4.Equals(version))
53 MessageTextBox.AppendText(string.Format("\r\nMicrosoft .NET Framework: {0}", version));
54 if (!string.IsNullOrEmpty(Util.CheckAviSynth()))
55 MessageTextBox.AppendText("\r\n" + Util.CheckAviSynth());
56 else if (!string.IsNullOrEmpty(Util.CheckinternalAviSynth()))
57 MessageTextBox.AppendText("\r\n" + Util.CheckinternalAviSynth()+" (本地内置的绿色版本)");
58 else
59 MessageTextBox.AppendText("\r\nAvisynth 未安装");
60 MessageTextBox.AppendText("\r\n------------------------------以上信息为自动检测请勿修改------------------------\r\n\r\n");
63 private string ReadLogFile(string logPath)
65 string logContent = File.ReadAllText(logPath);
66 //logContent = logContent.Replace("\r\n", "<br /");
67 return logContent;
70 private void PostButton_Click(object sender, EventArgs e)
72 string name = UserNameTextBox.Text;
73 string qq = QQTextBox.Text;
74 string email = EmailTextBox.Text;
75 string title = TitleTextBox.Text;
76 string msg = MessageTextBox.Text;
77 string log = "";
78 if (!string.IsNullOrEmpty(LogPathTextBox.Text))
80 if (File.Exists(LogPathTextBox.Text))
82 log = ReadLogFile(LogPathTextBox.Text);
84 else
86 ShowErrorMessage("请输入正确的日志文件路径!");
87 return;
91 if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(title) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(msg))
93 ShowWarningMessage("请填写以上必填项后再提交!");
94 return;
97 ServiceReference.WebServiceSoapClient service = new ServiceReference.WebServiceSoapClient();
98 bool flag = service.PostFeedback(name, qq, email, title, msg, log);
100 if (flag)
102 ShowInfoMessage("提交成功,感谢反馈!");
104 else
106 ShowErrorMessage("提交失败!");
108 TitleTextBox.Clear();
109 MessageTextBox.Clear();
112 private void LogFileButton_Click(object sender, EventArgs e)
114 OpenFileDialog ofd = new OpenFileDialog();
115 ofd.Filter = "日志文件(*.log)|*.log|所有文件(*.*)|*.*";
116 DialogResult result = ofd.ShowDialog();
117 if (result == DialogResult.OK)
119 LogPathTextBox.Text = ofd.FileName;