Skip to content

Commit

Permalink
Update v0.2.0.79
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DingpingZhang committed Mar 17, 2017
1 parent ce9be5a commit 8af7679
Show file tree
Hide file tree
Showing 82 changed files with 2,477 additions and 709 deletions.
94 changes: 94 additions & 0 deletions BaiduPanDownloadWpf.Core.Test/BaiduPanDownloadWpf.Core.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{265B76DF-7557-4C12-9DFF-3A83889519EF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BaiduPanDownloadWpf.Core.Test</RootNamespace>
<AssemblyName>BaiduPanDownloadWpf.Core.Test</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="BaiduServerTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StringExtensionTest.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BaiduPanDownloadWpf.Core\BaiduPanDownloadWpf.Core.csproj">
<Project>{51154046-CBD6-4BF7-80AE-356FFF2EB1B8}</Project>
<Name>BaiduPanDownloadWpf.Core</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
24 changes: 24 additions & 0 deletions BaiduPanDownloadWpf.Core.Test/BaiduServerTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BaiduPanDownloadWpf.Core;
using System.Threading.Tasks;

namespace BaiduPanDownloadWpf.Core.Test
{
[TestClass]
public class BaiduServerTest
{
[TestMethod]
public async Task LoginTest()
{
using (var baiduServer = new BaiduServer())
{
await baiduServer.SetUsernameAsync("FuckBaidu");
if (baiduServer.HasVerificationCode)
{
//await baiduServer.SetVerificationCodeAsync("grf3rgf");
}
}
}
}
}
36 changes: 36 additions & 0 deletions BaiduPanDownloadWpf.Core.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BaiduPanDownloadWpf.Core.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BaiduPanDownloadWpf.Core.Test")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("265b76df-7557-4c12-9dff-3a83889519ef")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
79 changes: 79 additions & 0 deletions BaiduPanDownloadWpf.Core.Test/StringExtensionTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BaiduPanDownloadWpf.Core;
using System.Security.Cryptography;
using System.IO;

namespace BaiduPanDownloadWpf.Core.Test
{
//[TestClass]
public class StringExtensionTest
{
private readonly List<string> _testTexts = new List<string>
{
"",
"a",
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // RSA Maximum allowable length: 117
"~!@#$%^&*()_+",
"`1234567890-=",
"qwertyuiop[]\\asdfghjkl;'zxcvbnm,./",
"QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?",
};


//[TestMethod]
public void ToMd5Test()
{
const string password = "123456789";
var md5 = password.ToMd5();
Assert.IsTrue(md5 == "25f9e794323b453885f5181f1b624d0b".ToUpper());
}

//[TestMethod]
public void EnDecryptRijndaelTest()
{
foreach (var item in _testTexts)
{
var en = item.EncryptByRijndael();
var de = en.DecryptByRijndael();
Assert.IsTrue(item == de);
}
}

//[TestMethod]
public void EnDecryptRSATest()
{
foreach (var item in _testTexts)
{
var en = item.EncryptByRSA();
//var de = en.DecryptByRSA();
//Assert.IsTrue(item == de);
}
}

//[TestMethod]
public void DecryptEmptyStringTest()
{
//string.Empty.DecryptByRijndael();
//string.Empty.DecryptByRSA();
}

//[TestMethod]
public void GenerateRSAKey()
{
var rsa = new RSACryptoServiceProvider();
var publicKey = rsa.ToXmlString(false);
var privateKey = rsa.ToXmlString(true);
var publicKeyPath = Path.Combine(Directory.GetCurrentDirectory(), "publickey.xml");
var privateKeyPath = Path.Combine(Directory.GetCurrentDirectory(), "privatekey.xml");
File.WriteAllText(publicKeyPath, publicKey);
File.WriteAllText(privateKeyPath, privateKey);
}
}
}
10 changes: 8 additions & 2 deletions BaiduPanDownloadWpf.Core/BaiduPanDownloadWpf.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand All @@ -73,6 +75,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BaiduServer.cs" />
<Compile Include="Common.cs" />
<Compile Include="DownloadEngine\DownloadTask.cs" />
<Compile Include="DownloadEngine\DownloadTaskManager.cs" />
<Compile Include="DownloadEngine\DownloadTaskToken.cs" />
Expand All @@ -84,11 +88,13 @@
<Compile Include="Download\DownloadCore\HttpDownload.cs" />
<Compile Include="Download\TaskDatabase.cs" />
<Compile Include="Download\TaskManager.cs" />
<Compile Include="LocalDiskUserRepository.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="LocalConfigInfo.cs" />
<Compile Include="MountUserRepository.cs" />
<Compile Include="ModelBase.cs" />
<Compile Include="DownloadCoreModule.cs" />
<Compile Include="LocalDiskFile.cs" />
<Compile Include="LocalDiskUser.cs" />
<Compile Include="MountUser.cs" />
<Compile Include="NetDiskFile.cs" />
<Compile Include="NetDiskUser.cs" />
<Compile Include="NetWork\Cookies.cs" />
Expand Down
Loading

0 comments on commit 8af7679

Please sign in to comment.