Commit fcbf3f98 authored by JoyJ's avatar JoyJ

添加项目文件。

parent 273a7618

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YRP2Video", "YRP2Video\YRP2Video.csproj", "{80309476-0709-446E-830A-82112E857BB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{80309476-0709-446E-830A-82112E857BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80309476-0709-446E-830A-82112E857BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80309476-0709-446E-830A-82112E857BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80309476-0709-446E-830A-82112E857BB6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3CEAED16-9C76-4BC2-8362-2A06AA5F01D8}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="YRP2Video.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<YRP2Video.Properties.Settings>
<setting name="AuthKey" serializeAs="String">
<value />
</setting>
</YRP2Video.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace YRP2Video
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new YRP2Video());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("YRP2Video")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("YRP2Video")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("80309476-0709-446e-830a-82112e857bb6")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace YRP2Video.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("YRP2Video.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace YRP2Video.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string AuthKey {
get {
return ((string)(this["AuthKey"]));
}
set {
this["AuthKey"] = value;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="YRP2Video.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="AuthKey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
namespace YRP2Video
{
partial class VideoStatus
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.split = new System.Windows.Forms.SplitContainer();
this.lbFileName = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.split)).BeginInit();
this.split.Panel1.SuspendLayout();
this.split.SuspendLayout();
this.SuspendLayout();
//
// split
//
this.split.Dock = System.Windows.Forms.DockStyle.Fill;
this.split.Location = new System.Drawing.Point(0, 0);
this.split.Name = "split";
//
// split.Panel1
//
this.split.Panel1.Controls.Add(this.lbFileName);
this.split.Size = new System.Drawing.Size(743, 37);
this.split.SplitterDistance = 129;
this.split.TabIndex = 0;
//
// lbFileName
//
this.lbFileName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.lbFileName.AutoSize = true;
this.lbFileName.Location = new System.Drawing.Point(12, 14);
this.lbFileName.Name = "lbFileName";
this.lbFileName.Size = new System.Drawing.Size(53, 12);
this.lbFileName.TabIndex = 0;
this.lbFileName.Text = "FileName";
//
// VideoStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.split);
this.Name = "VideoStatus";
this.Size = new System.Drawing.Size(743, 37);
this.split.Panel1.ResumeLayout(false);
this.split.Panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.split)).EndInit();
this.split.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer split;
private System.Windows.Forms.Label lbFileName;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace YRP2Video
{
public partial class VideoStatus : UserControl
{
public VideoStatus()
{
this.InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
namespace YRP2Video
{
partial class YRP2Video
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(YRP2Video));
this.dgvData = new System.Windows.Forms.DataGridView();
this.btnRefresh = new System.Windows.Forms.Button();
this.btnAddFile = new System.Windows.Forms.Button();
this.ofdOpen = new System.Windows.Forms.OpenFileDialog();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.pbDownload = new System.Windows.Forms.ToolStripProgressBar();
this.lbStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.btnDownload = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.sfdSave = new System.Windows.Forms.SaveFileDialog();
this.fbdSave = new System.Windows.Forms.FolderBrowserDialog();
this.txtAuthKey = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// dgvData
//
this.dgvData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvData.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Location = new System.Drawing.Point(12, 12);
this.dgvData.Name = "dgvData";
this.dgvData.ReadOnly = true;
this.dgvData.RowTemplate.Height = 23;
this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvData.Size = new System.Drawing.Size(960, 509);
this.dgvData.TabIndex = 3;
//
// btnRefresh
//
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnRefresh.Location = new System.Drawing.Point(879, 527);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(93, 35);
this.btnRefresh.TabIndex = 4;
this.btnRefresh.Text = "刷新";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// btnAddFile
//
this.btnAddFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnAddFile.Location = new System.Drawing.Point(780, 527);
this.btnAddFile.Name = "btnAddFile";
this.btnAddFile.Size = new System.Drawing.Size(93, 35);
this.btnAddFile.TabIndex = 5;
this.btnAddFile.Text = "添加文件";
this.btnAddFile.UseVisualStyleBackColor = true;
this.btnAddFile.Click += new System.EventHandler(this.btnAddFile_Click);
//
// ofdOpen
//
this.ofdOpen.FileName = "input.yrp";
this.ofdOpen.Filter = "YRP 文件|*.yrp";
this.ofdOpen.Multiselect = true;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.pbDownload,
this.lbStatus});
this.statusStrip1.Location = new System.Drawing.Point(0, 581);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(984, 22);
this.statusStrip1.TabIndex = 6;
this.statusStrip1.Text = "statusStrip1";
//
// pbDownload
//
this.pbDownload.Name = "pbDownload";
this.pbDownload.Size = new System.Drawing.Size(100, 16);
this.pbDownload.Visible = false;
//
// lbStatus
//
this.lbStatus.Name = "lbStatus";
this.lbStatus.Size = new System.Drawing.Size(32, 17);
this.lbStatus.Text = "就绪";
//
// btnDownload
//
this.btnDownload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnDownload.Location = new System.Drawing.Point(681, 527);
this.btnDownload.Name = "btnDownload";
this.btnDownload.Size = new System.Drawing.Size(93, 35);
this.btnDownload.TabIndex = 7;
this.btnDownload.Text = "下载选中";
this.btnDownload.UseVisualStyleBackColor = true;
this.btnDownload.Click += new System.EventHandler(this.btnDownload_Click);
//
// btnDelete
//
this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnDelete.Location = new System.Drawing.Point(582, 527);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(93, 35);
this.btnDelete.TabIndex = 8;
this.btnDelete.Text = "删除选中";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// sfdSave
//
this.sfdSave.FileName = "output.mp4";
this.sfdSave.Filter = "YRP 文件|*.mp4";
//
// txtAuthKey
//
this.txtAuthKey.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtAuthKey.Location = new System.Drawing.Point(83, 541);
this.txtAuthKey.Name = "txtAuthKey";
this.txtAuthKey.Size = new System.Drawing.Size(209, 21);
this.txtAuthKey.TabIndex = 9;
this.txtAuthKey.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 544);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 12);
this.label1.TabIndex = 10;
this.label1.Text = "认证秘钥:";
//
// YRP2Video
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 603);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtAuthKey);
this.Controls.Add(this.btnDelete);
this.Controls.Add(this.btnDownload);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.btnAddFile);
this.Controls.Add(this.btnRefresh);
this.Controls.Add(this.dgvData);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "YRP2Video";
this.Text = "yrp视频转换器";
this.Load += new System.EventHandler(this.YRP2Video_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.YRP2Video_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.YRP2Video_DragEnter);
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.Button btnAddFile;
private System.Windows.Forms.OpenFileDialog ofdOpen;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel lbStatus;
private System.Windows.Forms.ToolStripProgressBar pbDownload;
private System.Windows.Forms.Button btnDownload;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.SaveFileDialog sfdSave;
private System.Windows.Forms.FolderBrowserDialog fbdSave;
private System.Windows.Forms.TextBox txtAuthKey;
private System.Windows.Forms.Label label1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Windows.Forms;
namespace YRP2Video
{
public partial class YRP2Video : Form
{
public YRP2Video()
{
this.InitializeComponent();
}
private string UrlEncode(string str)
{
return Uri.EscapeDataString(str);
}
private string ToBase64(string file)
{
byte[] resultArray = File.ReadAllBytes(file);
string result = Convert.ToBase64String(resultArray, 0, resultArray.Length);
return result;
}
private string HttpGet(string url, Encoding encoding = null)
{
if (encoding == null)
{
encoding = Encoding.Default;
}
string htmlCode = null;
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Headers.Add("Authorization", txtAuthKey.Text);
webRequest.Timeout = 30000;
webRequest.Method = "GET";
webRequest.UserAgent = "Mozilla/4.0";
webRequest.Headers.Add("Accept-Encoding", "gzip, deflate");
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
if (webResponse.ContentEncoding.ToLower() == "gzip")//如果使用了GZip则先解压
{
Stream streamReceive = webResponse.GetResponseStream();
var zipStream =
new System.IO.Compression.GZipStream(streamReceive, System.IO.Compression.CompressionMode.Decompress);
StreamReader sr = new System.IO.StreamReader(zipStream, encoding);
htmlCode = sr.ReadToEnd();
sr.Close();
zipStream.Close();
streamReceive.Close();
}
else
{
Stream streamReceive = webResponse.GetResponseStream();
StreamReader sr = new System.IO.StreamReader(streamReceive, encoding);
htmlCode = sr.ReadToEnd();
sr.Close();
streamReceive.Close();
}
return htmlCode.TrimStart('\n');
}
private string HttpPost(string url, string data, Encoding encoding = null)
{
if (encoding == null)
{
encoding = Encoding.Default;
}
byte[] bytesToPost = encoding.GetBytes(data);
string result = null;
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Headers.Add("Authorization", "WUEHSvMeNhj7NCm1jf");
req.ContentType = "application/json";
req.Method = "POST";
req.ContentLength = bytesToPost.Length;
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bytesToPost, 0, bytesToPost.Length);
}
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
if (res != null)
{
StreamReader sr;
using (sr = new StreamReader(res.GetResponseStream()))
{
result = sr.ReadToEnd();
}
sr.Close();
}
res.Close();
return result;
}
private void btnTest2_Click(object sender, EventArgs e)
{
string url = $"https://yunomi.mycard.moe/video/task?id=7ad082ae-b3fd-4c8c-9eb5-9e08f2d6368a";
MessageBox.Show(this.HttpGet(url));
}
DataTable table = null;
private void YRP2Video_Load(object sender, EventArgs e)
{
try
{
DataSet ds = new DataSet();
ds.ReadXml("yrp2video.conf");
if (ds.Tables.Count < 1)
{
throw new Exception();
}
table = ds.Tables[0].Copy();
ds.Dispose();
}
catch
{
table = new DataTable();
table.Columns.Add("文件名");
table.Columns.Add("ID");
table.Columns.Add("转换情况");
table.Columns.Add("其他信息");
table.Columns.Add("完成时间");
}
dgvData.DataSource = table;
txtAuthKey.Text = Properties.Settings.Default.AuthKey;
init = true;
}
private JavaScriptSerializer json = new JavaScriptSerializer();
private string JSONEncode(object obj)
{
return this.json.Serialize(obj);
}
private T JSONDecode<T>(string str)
{
return this.json.Deserialize<T>(str);
}
private string JSONEncode(object obj, string pass)
{
string result = this.json.Serialize(obj);
return this.Encryption(result, pass);
}
private T JSONDecode<T>(string str, string pass)
{
str = Decryption(str, pass);
return this.json.Deserialize<T>(str);
}
private string Encryption(string str, string key = "aaaaaaaaaaaaaaaa")
{
if (string.IsNullOrEmpty(str))
{
return null;
}
byte[] toEncryptArray = Encoding.UTF8.GetBytes(str);
RijndaelManaged rm = new RijndaelManaged
{
Key = Encoding.UTF8.GetBytes(key),
Mode = CipherMode.ECB,
Padding = PaddingMode.PKCS7
};
ICryptoTransform cTransform = rm.CreateEncryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
return Convert.ToBase64String(resultArray, 0, resultArray.Length).Replace("/", "_").Replace("+", "-");
}
public static string Decryption(string str, string key = "aaaaaaaaaaaaaaaa")
{
str = str.Replace("_", "/").Replace("-", "+");
if (string.IsNullOrEmpty(str))
{
return null;
}
byte[] toEncryptArray = Convert.FromBase64String(str);
RijndaelManaged rm = new RijndaelManaged
{
Key = Encoding.UTF8.GetBytes(key),
Mode = CipherMode.ECB,
Padding = PaddingMode.PKCS7
};
ICryptoTransform cTransform = rm.CreateDecryptor();
byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
return Encoding.UTF8.GetString(resultArray);
}
private void DownloadFile(string url, string fileName, ToolStripProgressBar pb, ToolStripLabel lb)
{
Stream st = null;
Stream so = null;
FileInfo fi = new FileInfo(fileName);
if (!fi.Directory.Exists)
{
Directory.CreateDirectory(fi.Directory.FullName);
}
try
{
HttpWebRequest Myrq = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse myrp = (HttpWebResponse)Myrq.GetResponse();
long totalBytes = myrp.ContentLength;
pb.Maximum = (int)totalBytes;
st = myrp.GetResponseStream();
so = new FileStream(fileName, FileMode.Create);
long totalDownloadedByte = 0;
byte[] by = new byte[1024 * 512];
int osize = st.Read(by, 0, by.Length);
while (osize > 0)
{
totalDownloadedByte = osize + totalDownloadedByte;
Application.DoEvents();
so.Write(by, 0, osize);
if (pb != null)
{
pb.Value = (int)totalDownloadedByte;
}
osize = st.Read(by, 0, by.Length);
float percent = totalDownloadedByte / (float)totalBytes * 100;
lb.Text = $"正在下载 {fileName} :" + Math.Round(percent, 2).ToString().PadLeft(6) + "%";
Application.DoEvents();
}
if (pb != null)
{
pb.Value = pb.Maximum;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
so?.Close();
st?.Close();
}
}
private void btnAddFile_Click(object sender, EventArgs e)
{
if (ofdOpen.ShowDialog() == DialogResult.OK)
{
foreach(string file in ofdOpen.FileNames)
{
this.AddFile(file);
}
}
this.SaveToFile();
}
private void RefreshRow(ref DataRow row, string json)
{
Result res = this.JSONDecode<Result>(json);
if (!res.success)
{
return;
}
row["ID"] = res;
switch (res.task.status)
{
case "finished":
row["转换情况"] = "已完成";
break;
case "running":
row["转换情况"] = "运行中";
break;
case "pending":
row["转换情况"] = "等待中";
break;
case "queue":
row["转换情况"] = "队列中";
break;
default:
row["转换情况"] = res.task.status;
break;
}
row["其他信息"] = res.task.failMessage != null ? "失败:" + res.task.failMessage : "";
row["完成时间"] = res.task.completeTime != null ? res.task.completeTime : "N/A";
Application.DoEvents();
}
private void AddFile(string file)
{
lbStatus.Text = "正在添加任务:" + file;
Application.DoEvents();
DataRow row = table.NewRow();
/*
table.Columns.Add("文件名");
table.Columns.Add("ID");
table.Columns.Add("转换情况");
table.Columns.Add("其他信息");
table.Columns.Add("完成时间"); */
row["文件名"] = new FileInfo(file).Name;
string base64 = this.ToBase64(file);
Replay rep = new Replay()
{
replay = base64
};
string url = "https://yunomi.mycard.moe/video/task";
try
{
string result = this.HttpPost(url, this.JSONEncode(rep));
this.RefreshRow(ref row, result);
}
catch(Exception ex)
{
MessageBox.Show($"文件{file}添加失败,错误信息:{ex.Message}", "错误");
return;
}
table.Rows.Add(row);
lbStatus.Text = "就绪";
Application.DoEvents();
}
private void YRP2Video_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.All;
}
private void YRP2Video_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach(string file in files)
{
if (Directory.Exists(file))
{
foreach (string f in Directory.EnumerateFiles(file, "*.yrp", SearchOption.AllDirectories))
{
this.AddFile(f);
}
}
else if (file.ToLower().EndsWith(".yrp"))
{
this.AddFile(file);
}
}
}
private void btnDelete_Click(object sender, EventArgs e)
{
List<string> shouldDelete = new List<string>();
for(int i=0;i<dgvData.Rows.Count; i++)
{
if (dgvData.Rows[i].Cells["ID"].Value == null)
{
continue;
}
if ((dgvData.Rows.GetRowState(i) & DataGridViewElementStates.Selected) > 0)
{
shouldDelete.Add(dgvData.Rows[i].Cells["ID"].Value.ToString());
}
}
int count = table.Rows.Count - 1;
for(; count > -1; count--)
{
if (shouldDelete.Contains(table.Rows[count]["ID"].ToString()))
{
table.Rows.RemoveAt(count);
}
}
this.SaveToFile();
}
private void SaveToFile()
{
DataSet ds = new DataSet();
ds.Tables.Add(table.Copy());
ds.WriteXml("yrp2video.conf");
ds.Dispose();
}
private void btnRefresh_Click(object sender, EventArgs e)
{
for(int i = 0; i < table.Rows.Count; i++)
{
try
{
string id = table.Rows[i]["ID"].ToString();
if (string.IsNullOrEmpty(id))
{
continue;
}
string url = $"https://yunomi.mycard.moe/video/task?id={id}";
string json = this.HttpGet(url);
DataRow row = table.Rows[i];
this.RefreshRow(ref row, json);
}
catch { }
}
this.SaveToFile();
}
private void btnDownload_Click(object sender, EventArgs e)
{
bool single = false;
if (dgvData.SelectedRows.Count > 1)
{
if (fbdSave.ShowDialog() != DialogResult.OK)
{
return;
}
}
else
{
single = true;
if (sfdSave.ShowDialog() != DialogResult.OK)
{
return;
}
}
for(int i = 0; i < dgvData.Rows.Count; i++)
{
if ((dgvData.Rows.GetRowState(i) & DataGridViewElementStates.Selected) == 0)
{
continue;
}
string fileName = ((string)dgvData.Rows[i].Cells["文件名"].Value);
if (single)
{
fileName = sfdSave.FileName;
}
else
{
fileName = fbdSave.SelectedPath + "\\" + fileName + ".mp4";
}
string dLink = this.GetDownloadLinkWithId(dgvData.Rows[i].Cells["ID"].Value.ToString());
if (dLink != null)
{
pbDownload.Visible = true;
this.DownloadFile(dLink, fileName, pbDownload, lbStatus);
pbDownload.Visible = false;
lbStatus.Text = "就绪";
}
}
}
private string GetDownloadLinkWithId(string id)
{
try
{
string url = $"https://yunomi.mycard.moe/video/task?id={id}";
string json = this.HttpGet(url);
Result res = this.JSONDecode<Result>(json);
return res.task.downloadLink;
}
catch { }
return null;
}
bool init = false;
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (init)
{
Properties.Settings.Default.AuthKey = txtAuthKey.Text;
Properties.Settings.Default.Save();
}
}
}
public class Replay
{
public string replay;
}
public class Result
{
public bool success;
public ReplayTask task;
public override string ToString()
{
return task.id;
}
}
public class ReplayTask
{
public string id;
public string replayContent;
public string status;
public string downloadLink;
public string failMessage;
public string completeTime;
public override string ToString()
{
return id;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{80309476-0709-446E-830A-82112E857BB6}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>YRP2Video</RootNamespace>
<AssemblyName>YRP2Video</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>20210131040720336_easyicon_net_512.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="VideoStatus.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="VideoStatus.Designer.cs">
<DependentUpon>VideoStatus.cs</DependentUpon>
</Compile>
<Compile Include="YRP2Video.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="YRP2Video.Designer.cs">
<DependentUpon>YRP2Video.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="VideoStatus.resx">
<DependentUpon>VideoStatus.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="YRP2Video.resx">
<DependentUpon>YRP2Video.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="20210131040720336_easyicon_net_512.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment