First in 202205060145
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System.Timers;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Threading_Demo3
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
demo demo1 = new demo();
|
||||
demo1.spin ();
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
class demo
|
||||
{
|
||||
private Action action1 { get; set; }
|
||||
private Action action2 { get; set; }
|
||||
private Action action3 { get; set; }
|
||||
private Action action4 { get; set; }
|
||||
private int count { get; set; }
|
||||
private int count1 { get; set; }
|
||||
public System.Timers.Timer timer1 { get; set; }
|
||||
public demo()
|
||||
{
|
||||
this.action1 = new Action(this.say);
|
||||
this.action2 = new Action(this.spin);
|
||||
this.action3 = new Action(this.spin2);
|
||||
this.action3 = new Action(this.spin3);
|
||||
this.count = 0;
|
||||
this.count1 = 0;
|
||||
this.timer1 = new System.Timers.Timer();
|
||||
this.timer1.Interval = 15;
|
||||
this.timer1.Elapsed += this.say2;
|
||||
}
|
||||
|
||||
private void spin2()
|
||||
{
|
||||
Thread.Sleep(12);
|
||||
this.action1.Invoke();
|
||||
this.action4.Invoke();
|
||||
}
|
||||
|
||||
private void spin3()
|
||||
{
|
||||
Thread.Sleep(11);
|
||||
if (count<=180)
|
||||
{
|
||||
this.action1.Invoke();
|
||||
this.action2.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void say2(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
this.count1++;
|
||||
if (this.count1 <= 180)
|
||||
{
|
||||
Console.WriteLine("{0}\tLong Live TouHou!\t{1}", count1.ToString(), DateTime.UtcNow.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
this.timer1.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void say()
|
||||
{
|
||||
this.count++;
|
||||
Console.WriteLine("{0}\tLong Live TouHou!\t{1}",count.ToString(),DateTime.UtcNow.ToString());
|
||||
Form forms = new Form();
|
||||
forms.Text = DateTime.UtcNow.ToString();
|
||||
forms.ShowDialog();
|
||||
Thread.Sleep(50);
|
||||
forms.Close ();
|
||||
}
|
||||
|
||||
public void spin()
|
||||
{
|
||||
Thread.Sleep(12);
|
||||
this.action1.Invoke();
|
||||
this.action3.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("ConsoleApp1")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ConsoleApp1")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("53eaa6ae-6c72-4f64-b3c0-ec660c4431fc")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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>{53EAA6AE-6C72-4F64-B3C0-EC660C4431FC}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ConsoleApp1</RootNamespace>
|
||||
<AssemblyName>ConsoleApp1</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</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>
|
||||
<ItemGroup>
|
||||
<Reference Include="OpenCL.Net, Version=2.2.9.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\THCCD Demo\packages\OpenCL.Net.2.2.9.0\lib\net40\OpenCL.Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\THCCD Demo\packages\OpenCL.Net.2.2.9.0\build\net40\OpenCL.Net.targets" Condition="Exists('..\THCCD Demo\packages\OpenCL.Net.2.2.9.0\build\net40\OpenCL.Net.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\THCCD Demo\packages\OpenCL.Net.2.2.9.0\build\net40\OpenCL.Net.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\THCCD Demo\packages\OpenCL.Net.2.2.9.0\build\net40\OpenCL.Net.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
277526e6458b7c0ee0115c49957c0929904d1374
|
||||
@@ -0,0 +1,7 @@
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\bin\Debug\ConsoleApp1.exe.config
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\bin\Debug\ConsoleApp1.exe
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\bin\Debug\ConsoleApp1.pdb
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\obj\Debug\Threading Demo3.csproj.CoreCompileInputs.cache
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\obj\Debug\ConsoleApp1.exe
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\obj\Debug\ConsoleApp1.pdb
|
||||
D:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\工程\源代码\Demo\ConsoleApp1\obj\Debug\Threading Demo3.csproj.AssemblyReference.cache
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="OpenCL.Net" version="2.2.9.0" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user