Skip to content

Commit 8af7679

Browse files
committed
Update v0.2.0.79
1.Add automatic login and remember password function. 2.Add software icon. 3.Adjust the UI structure. 4.Make the download more stable. 5.Some other minor work.
1 parent ce9be5a commit 8af7679

File tree

82 files changed

+2477
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2477
-709
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{265B76DF-7557-4C12-9DFF-3A83889519EF}</ProjectGuid>
7+
<OutputType>Library</OutputType>
8+
<AppDesignerFolder>Properties</AppDesignerFolder>
9+
<RootNamespace>BaiduPanDownloadWpf.Core.Test</RootNamespace>
10+
<AssemblyName>BaiduPanDownloadWpf.Core.Test</AssemblyName>
11+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
15+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
16+
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
17+
<IsCodedUITest>False</IsCodedUITest>
18+
<TestProjectType>UnitTest</TestProjectType>
19+
<SccProjectName>SAK</SccProjectName>
20+
<SccLocalPath>SAK</SccLocalPath>
21+
<SccAuxPath>SAK</SccAuxPath>
22+
<SccProvider>SAK</SccProvider>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25+
<DebugSymbols>true</DebugSymbols>
26+
<DebugType>full</DebugType>
27+
<Optimize>false</Optimize>
28+
<OutputPath>bin\Debug\</OutputPath>
29+
<DefineConstants>DEBUG;TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>true</Optimize>
36+
<OutputPath>bin\Release\</OutputPath>
37+
<DefineConstants>TRACE</DefineConstants>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
</PropertyGroup>
41+
<ItemGroup>
42+
<Reference Include="System" />
43+
</ItemGroup>
44+
<Choose>
45+
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
46+
<ItemGroup>
47+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
48+
</ItemGroup>
49+
</When>
50+
<Otherwise>
51+
<ItemGroup>
52+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
53+
</ItemGroup>
54+
</Otherwise>
55+
</Choose>
56+
<ItemGroup>
57+
<Compile Include="BaiduServerTest.cs" />
58+
<Compile Include="Properties\AssemblyInfo.cs" />
59+
<Compile Include="StringExtensionTest.cs" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<ProjectReference Include="..\BaiduPanDownloadWpf.Core\BaiduPanDownloadWpf.Core.csproj">
63+
<Project>{51154046-CBD6-4BF7-80AE-356FFF2EB1B8}</Project>
64+
<Name>BaiduPanDownloadWpf.Core</Name>
65+
</ProjectReference>
66+
</ItemGroup>
67+
<Choose>
68+
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
69+
<ItemGroup>
70+
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
71+
<Private>False</Private>
72+
</Reference>
73+
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
74+
<Private>False</Private>
75+
</Reference>
76+
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
77+
<Private>False</Private>
78+
</Reference>
79+
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
80+
<Private>False</Private>
81+
</Reference>
82+
</ItemGroup>
83+
</When>
84+
</Choose>
85+
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
86+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
87+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
88+
Other similar extension points exist, see Microsoft.Common.targets.
89+
<Target Name="BeforeBuild">
90+
</Target>
91+
<Target Name="AfterBuild">
92+
</Target>
93+
-->
94+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using BaiduPanDownloadWpf.Core;
4+
using System.Threading.Tasks;
5+
6+
namespace BaiduPanDownloadWpf.Core.Test
7+
{
8+
[TestClass]
9+
public class BaiduServerTest
10+
{
11+
[TestMethod]
12+
public async Task LoginTest()
13+
{
14+
using (var baiduServer = new BaiduServer())
15+
{
16+
await baiduServer.SetUsernameAsync("FuckBaidu");
17+
if (baiduServer.HasVerificationCode)
18+
{
19+
//await baiduServer.SetVerificationCodeAsync("grf3rgf");
20+
}
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("BaiduPanDownloadWpf.Core.Test")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("BaiduPanDownloadWpf.Core.Test")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("265b76df-7557-4c12-9dff-3a83889519ef")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Text.RegularExpressions;
7+
using System.Threading.Tasks;
8+
using Microsoft.VisualStudio.TestTools.UnitTesting;
9+
using BaiduPanDownloadWpf.Core;
10+
using System.Security.Cryptography;
11+
using System.IO;
12+
13+
namespace BaiduPanDownloadWpf.Core.Test
14+
{
15+
//[TestClass]
16+
public class StringExtensionTest
17+
{
18+
private readonly List<string> _testTexts = new List<string>
19+
{
20+
"",
21+
"a",
22+
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // RSA Maximum allowable length: 117
23+
"~!@#$%^&*()_+",
24+
"`1234567890-=",
25+
"qwertyuiop[]\\asdfghjkl;'zxcvbnm,./",
26+
"QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?",
27+
};
28+
29+
30+
//[TestMethod]
31+
public void ToMd5Test()
32+
{
33+
const string password = "123456789";
34+
var md5 = password.ToMd5();
35+
Assert.IsTrue(md5 == "25f9e794323b453885f5181f1b624d0b".ToUpper());
36+
}
37+
38+
//[TestMethod]
39+
public void EnDecryptRijndaelTest()
40+
{
41+
foreach (var item in _testTexts)
42+
{
43+
var en = item.EncryptByRijndael();
44+
var de = en.DecryptByRijndael();
45+
Assert.IsTrue(item == de);
46+
}
47+
}
48+
49+
//[TestMethod]
50+
public void EnDecryptRSATest()
51+
{
52+
foreach (var item in _testTexts)
53+
{
54+
var en = item.EncryptByRSA();
55+
//var de = en.DecryptByRSA();
56+
//Assert.IsTrue(item == de);
57+
}
58+
}
59+
60+
//[TestMethod]
61+
public void DecryptEmptyStringTest()
62+
{
63+
//string.Empty.DecryptByRijndael();
64+
//string.Empty.DecryptByRSA();
65+
}
66+
67+
//[TestMethod]
68+
public void GenerateRSAKey()
69+
{
70+
var rsa = new RSACryptoServiceProvider();
71+
var publicKey = rsa.ToXmlString(false);
72+
var privateKey = rsa.ToXmlString(true);
73+
var publicKeyPath = Path.Combine(Directory.GetCurrentDirectory(), "publickey.xml");
74+
var privateKeyPath = Path.Combine(Directory.GetCurrentDirectory(), "privatekey.xml");
75+
File.WriteAllText(publicKeyPath, publicKey);
76+
File.WriteAllText(privateKeyPath, privateKey);
77+
}
78+
}
79+
}

BaiduPanDownloadWpf.Core/BaiduPanDownloadWpf.Core.csproj

+8-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
</Reference>
6666
<Reference Include="System" />
6767
<Reference Include="System.Core" />
68+
<Reference Include="System.Management" />
69+
<Reference Include="System.Net.Http" />
6870
<Reference Include="System.Web" />
6971
<Reference Include="System.Windows.Forms" />
7072
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -73,6 +75,8 @@
7375
</Reference>
7476
</ItemGroup>
7577
<ItemGroup>
78+
<Compile Include="BaiduServer.cs" />
79+
<Compile Include="Common.cs" />
7680
<Compile Include="DownloadEngine\DownloadTask.cs" />
7781
<Compile Include="DownloadEngine\DownloadTaskManager.cs" />
7882
<Compile Include="DownloadEngine\DownloadTaskToken.cs" />
@@ -84,11 +88,13 @@
8488
<Compile Include="Download\DownloadCore\HttpDownload.cs" />
8589
<Compile Include="Download\TaskDatabase.cs" />
8690
<Compile Include="Download\TaskManager.cs" />
87-
<Compile Include="LocalDiskUserRepository.cs" />
91+
<Compile Include="Extensions.cs" />
92+
<Compile Include="LocalConfigInfo.cs" />
93+
<Compile Include="MountUserRepository.cs" />
8894
<Compile Include="ModelBase.cs" />
8995
<Compile Include="DownloadCoreModule.cs" />
9096
<Compile Include="LocalDiskFile.cs" />
91-
<Compile Include="LocalDiskUser.cs" />
97+
<Compile Include="MountUser.cs" />
9298
<Compile Include="NetDiskFile.cs" />
9399
<Compile Include="NetDiskUser.cs" />
94100
<Compile Include="NetWork\Cookies.cs" />

0 commit comments

Comments
 (0)