Skip to content

Commit

Permalink
创建 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
EVA-SS committed Jun 6, 2022
1 parent e5b0e5a commit 7a61459
Show file tree
Hide file tree
Showing 29 changed files with 2,698 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/

# Other files and folders
*.csproj.user

# Executables
*.swf
*.air
*.ipa
*.apk
*.vcxproj.filters
*.vcxproj.user
*.pubxml.user

/.vs
/packages
/Debug
/Release
/x64
/x86
25 changes: 25 additions & 0 deletions AccelerateBall.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32526.322
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccelerateBall", "AccelerateBall\AccelerateBall.csproj", "{5ACE9884-E0BB-497E-AF03-4F9476A36A73}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5ACE9884-E0BB-497E-AF03-4F9476A36A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5ACE9884-E0BB-497E-AF03-4F9476A36A73}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5ACE9884-E0BB-497E-AF03-4F9476A36A73}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5ACE9884-E0BB-497E-AF03-4F9476A36A73}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6500D3DE-7346-4790-AED7-CF00C4D46E9B}
EndGlobalSection
EndGlobal
38 changes: 38 additions & 0 deletions AccelerateBall/Acc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace AccelerateBall
{
class Acc
{
[DllImport("kernel32.dll")]
private static extern int SetProcessWorkingSetSize(IntPtr hProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);

[DllImport("psapi.dll")]
static extern int EmptyWorkingSet(IntPtr hwProc);
public void ClearMemory()
{
GC.Collect();
GC.WaitForPendingFinalizers();
Process[] processes = Process.GetProcesses();
foreach (Process process in processes)
{
//以下系统进程没有权限,所以跳过,防止出错影响效率。
if ((process.ProcessName == "System") && (process.ProcessName == "Idle"))
continue;
try
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1);
}
EmptyWorkingSet(process.Handle);
}
catch
{
}
}
}
}
}
105 changes: 105 additions & 0 deletions AccelerateBall/AccelerateBall.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?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>{5ACE9884-E0BB-497E-AF03-4F9476A36A73}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AccelerateBall</RootNamespace>
<AssemblyName>AccelerateBall</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<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>favicon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Acc.cs" />
<Compile Include="BigForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BigForm.Designer.cs">
<DependentUpon>BigForm.cs</DependentUpon>
</Compile>
<Compile Include="CustomControl\MiniBallControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControl\MiniBallControl.Designer.cs">
<DependentUpon>MiniBallControl.cs</DependentUpon>
</Compile>
<Compile Include="MiniForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MiniForm.Designer.cs">
<DependentUpon>MiniForm.cs</DependentUpon>
</Compile>
<Compile Include="NetworkSpeed\NetworkAdapter.cs" />
<Compile Include="NetworkSpeed\NetworkMonitor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util\AppConfig.cs" />
<Compile Include="Util\MemoryInfo.cs" />
<Compile Include="Util\StartupSetting.cs" />
<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>
<DesignTime>True</DesignTime>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="favicon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\dot.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\lobei.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\loing.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\up_and_down.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\close_normal.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\close_press.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit 7a61459

Please sign in to comment.