Commit 850f5e4c by 李彦科

添加项目文件。

parent a1fba435
File added
File added
File added

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31702.278
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoTool", "DemoTool\DemoTool.csproj", "{D1F85F0C-2991-48BD-ACD7-952B40A30662}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D1F85F0C-2991-48BD-ACD7-952B40A30662}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1F85F0C-2991-48BD-ACD7-952B40A30662}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1F85F0C-2991-48BD-ACD7-952B40A30662}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1F85F0C-2991-48BD-ACD7-952B40A30662}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3E6ADB8-3537-4BC8-ACF2-075147157247}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<appSettings>
<!--主IP地址-->
<add key="HomeIP" value="117.40.88.30"/>
<!--备IP地址-->
<add key="PrepareIP" value="127.0.0.1"/>
<!--日志存储地址-->
<add key="LogPath" value="D:/txt/"/>
<!--日志存储地址-->
<add key="DataPath" value="D:/DemoToolSystemData/"/>
</appSettings>
</configuration>
\ No newline at end of file
<?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>{D1F85F0C-2991-48BD-ACD7-952B40A30662}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>DemoTool</RootNamespace>
<AssemblyName>DemoTool</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>
<ItemGroup>
<Reference Include="DllToolLib">
<HintPath>..\DLL\DllToolLib.dll</HintPath>
</Reference>
<Reference Include="ErrMsg">
<HintPath>..\DLL\ErrMsg.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NPinyin">
<HintPath>..\DLL\NPinyin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<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" />
<Reference Include="VizConnectC">
<HintPath>..\DLL\VizConnectC.dll</HintPath>
</Reference>
<Reference Include="WWW">
<HintPath>..\DLL\WWW.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tool\Log.cs" />
<Compile Include="Tool\LogMsg.cs" />
<Compile Include="Tool\TcpTool.cs" />
<Compile Include="Tool\VizCommand.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.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>
<None Include="XMLDemo\Demo.json" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?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>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="serialPort1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
</root>
\ No newline at end of file

namespace DemoTool
{
partial class Form2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(170, 239);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(170, 178);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 1;
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Name = "Form2";
this.Text = "Form2";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
}
}
\ No newline at end of file
using DemoTool.Tool;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DemoTool
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
Log log = new Log();
string text = "";
private void button1_Click(object sender, EventArgs e)
{
//byte[] buffer2 = { 0x01, 0x01, 0x00, 0x04, 0x05, 0x18, Convert.ToByte("AB"), Convert.ToByte("CD") };
byte[] buffer = { 32, 0, 12, 0, 0, 14,2, Convert.ToByte(171), Convert.ToByte(205) };
for (int i = 0; i <= 8; i++)
{
text+= buffer[i].ToString("X2")+" ";
}
//string time = DateTime.Now.ToString("YY-MMdd");
////string TxtPath = @"D:\txt\txt123\"+ time+".log";
//string TxtPath = @"D:\txt\txt123\";
//string postPath = TxtPath + DateTime.Now.ToString("yyyy-MMdd") + ".log";
//if (Directory.Exists(TxtPath) == false)
//{
// Directory.CreateDirectory(postPath);
//}
//else
//{
// //string postPath = TxtPath + DateTime.Now.ToString("yyyy-MMddHH") + ".txt";//路径+文件名
// log.deleteLog(@"D:\txt");
// using (System.IO.StreamWriter file = new System.IO.StreamWriter(postPath, true))
// {
// string swTxt = BitConverter.ToString(buffer).Replace(" - ", "");
// file.WriteLine(swTxt);
// }
//using (StreamWriter sw = File.AppendText(TxtPath))
//{
// string swTxt = BitConverter.ToString(buffer).Replace(" - ", "");
// //DirectoryInfo dinfo = new DirectoryInfo(@"D:\txt\");
// //DirectoryInfo dinfo2 = new DirectoryInfo(@"D:\txt");
// //FileSystemInfo[] fsin = dinfo.GetDirectories();
// //FileSystemInfo[] fsin2 = dinfo2.GetDirectories();
// log.deleteLog("D:/txt/");
// sw.WriteLine(swTxt);
//}
//}
//for (int i = 0; i < buffer.Length; i++)
//{
// if (buffer[i].ToString("X8").Replace("0", "") == "AB")
// {
// string sumTwo = buffer[i - 2].ToString();
// string Hmiao = buffer[i - 3].ToString();
// }
//}
}
}
}
<?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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DemoTool
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DemoTool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DemoTool")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("d1f85f0c-2991-48bd-acd7-952b40a30662")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [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 DemoTool.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("DemoTool.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>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DemoTool.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DemoTool.Tool
{
public class Log
{
string fileName;
public void CHelpIni(string filename)
{
FileInfo fileinfo = new FileInfo(filename);
if (!fileinfo.Exists)
{
StreamWriter sw = new StreamWriter(filename, false, Encoding.UTF8);
try
{
sw.WriteLine("#config.ini");
sw.Close();
}
catch
{
throw new ApplicationException("Ini文件不存在");
}
}
fileName = fileinfo.FullName;
}
static Thread threadLog;
public void deleteLog(object pathName)
{
var path = pathName as string;
int days = 2;
if (days < 1)
{
return;
}
List<String> listSave = new List<String>();//保存时间的字符串日期关键部分
            int saveDays = 0;//要保存的天数0
            for (int i = 0; i < days; i++)
{
listSave.Add("-" + DateTime.Now.AddDays(saveDays).ToString("MMdd"));//把要保存的日期添加进去
                saveDays--;//向后推移。
            }
listSave.RemoveAt(0);
//获取根目录下的所有文件夹
DirectoryInfo dinfo = new DirectoryInfo(path);
List<String> listAll = new List<string>();
FileSystemInfo[] fsin = dinfo.GetDirectories();
foreach (FileSystemInfo item in fsin)
{
listAll.Add(item.FullName);
}
for (int i = 0; i < listAll.Count; i++)
{
DirectoryInfo cdinfo = new DirectoryInfo(listAll[i]);
FileSystemInfo[] cfsin = cdinfo.GetFiles();
foreach (FileSystemInfo item in cfsin)
{
try
{
if (item.Name.Contains("log"))
{
bool result = false;
for (int j = 0; j < listSave.Count; j++)
{
if (item.FullName.Contains(listSave[j]))
{
result = true;//代表此日志需要保存
}
}
if (result)
{
//代表此日志需要删除
FileInfo file = new FileInfo(item.FullName);
file.Delete();
}
}
}
catch (Exception)
{
}
}
}
}
//public static void DeleteLog(object path)
//{
// if (threadLog != null)
// {
// try
// {
// threadLog.Abort();
// }
// catch (Exception)
// {
// }
// finally
// {
// threadLog = null;
// }
// }
// threadLog = new Thread(deleteLog);
// threadLog.IsBackground = true;
// threadLog.Start(path);
//}
}
}
using DllToolLib;
using ErrMsg;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DemoTool.Tool
{
public class LogMsg
{
public static void WriteErrLogMsg(string msg)
{
try
{
//string path = string.Format("{0}\\err_{1}.log", ConfigurationManager.AppSettings["LogPath"].ToString(), DateTime.Now.ToString("yyyyMMdd"));
string path = string.Format("{0}\\err_{1}.log", ConfigurationManager.AppSettings["LogPath"].ToString(), DateTime.Now.ToString("yyyyMMdd"));
string log_item = string.Format("{0}: {1}", DateTime.Now.ToString("hh:mm:ss"), "ChineseBridgeSystem、" + msg + "\r\n");
DebugEventArgs d1 = new DebugEventArgs(DebugType.err, "DemoTool24S、" + msg);
//Debug.OnRetrunDebug(d1);
FileIO.WriteTextFile(log_item, path, true, Encoding.UTF8);
}
catch (Exception ex)
{
; Console.WriteLine(ex.Message);
}
}
public static void WriteDataLogMsg(string data, string msg)
{
try
{
string path = string.Format("{0}\\{1}data_{2}.log", ConfigurationManager.AppSettings["DataPath"].ToString(), data, DateTime.Now.ToString("yyyyMMdd"));
string log_item = string.Format("{0}: {1}", DateTime.Now.ToString("hh:mm:ss"), "ChineseBridgeSystem、" + msg + "\r\n");
DebugEventArgs d1 = new DebugEventArgs(DebugType.err, "ChineseBridgeSystem、" + msg);
//Debug.OnRetrunDebug(d1);
FileIO.WriteTextFile(log_item, path, true, Encoding.UTF8);
}
catch (Exception ex)
{
; Console.WriteLine(ex.Message);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DemoTool.Tool
{
public class TcpTool
{
Socket socket; //定义一个Socket
public void SokcetCliet(string ip,string com)
{
try
{
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(IPAddress.Parse(ip), int.Parse(com));
ThreadPool.QueueUserWorkItem(OnSendOrReceive, socket);
//this.but_Client.Enabled = false;
//button1.Enabled = true;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
//ShowMsg("连接成功");
}
private void OnSendOrReceive(object sk)
{
var socket = sk as Socket;
while (true)
{
try
{
//客户端连接成功后,服务器应该接受客户端发来的消息
byte[] buffer = new byte[1024 * 1024 * 5];
//char[] vs = new char[1024 * 1024 * 5];
//实际接收到的字节数组
int r = socket.Receive(buffer);
if (r == 0)
{
break;
}
if (buffer[0] == 0)
{
//Encoding.ASCII.GetBytes(vs, 1, r - 1);
string str = Encoding.UTF8.GetString(buffer, 1, r - 1);
//ShowMsg(socket.RemoteEndPoint + ":" + str);
}
else if (buffer[1] == 1)
{
SaveFileDialog save = new SaveFileDialog();
save.InitialDirectory = @"C:\Users\18502\Desktop";
save.Title = "请选择要保存的文件";
save.Filter = "所有文件|*.*";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
// public class Time
// {
// namespace MyTimerDemo
// {
// public partial class Form1 : Form
// {
// #region 私有变量 定义
// /// <summary>
// /// 记录每次启动定时器的时间
// /// </summary>
// private DateTime startTime;
// /// <summary>
// /// 定时器已走时间
// /// </summary>
// private TimeSpan span;
// /// <summary>
// /// 记录每次暂停时定时器已走时间
// /// </summary>
// private TimeSpan pauseSpan;
// /// <summary>
// /// 时间(秒)
// /// </summary>
// private int time;
// /// <summary>
// /// 是否倒计时
// /// </summary>
// private bool bDown;
// /// <summary>
// /// 误差测试临时变量
// /// </summary>
// private int iCount = 0;
// #endregion
// public Form1()
// {
// InitializeComponent();
// timer1.Interval = 1; //每毫秒执行一次
// time = 0; //初始化时间
// //倒计时设定,如果时间为0则正计时,否则倒计时
// if (time == 0)
// {
// bDown = false;
// }
// else
// {
// bDown = true;
// }
// label1.Text = string.Format("00:00:{0}:000", time.ToString("00"));
// label2.Text = time.ToString("00");
// }
// /// <summary>
// /// 开始/暂停
// /// </summary>
// private void btnStartPause_Click(object sender, EventArgs e)
// {
// timer1.Enabled = !timer1.Enabled;
// if (timer1.Enabled) //开始
// {
// btnStartPause.Text = "Pause";
// //启动定时器,务必修改启动时间
// startTime = DateTime.Now;
// }
// else //暂停
// {
// btnStartPause.Text = "Start";
// //暂停,记录定时器当前已走时间
// pauseSpan = span;
// }
// }
// /// <summary>
// /// 停止定时器
// /// </summary>
// private void btnStop_Click(object sender, EventArgs e)
// {
// timer1.Enabled = false;
// btnStartPause.Enabled = true;
// btnStartPause.Text = "Start";
// pauseSpan = new TimeSpan(0); //将上次暂停 记录的已走时间清零
// label1.Text = string.Format("00:00:{0}:000", time.ToString("00"));
// label2.Text = time.ToString("00");
// }
// private void timer1_Tick(object sender, EventArgs e)
// {
// //刷新定时器已走时间
// //注意务必加上 上次暂停记录的已走时间
// span = (DateTime.Now - startTime).Add(pauseSpan);
// if (bDown) //倒计时
// {
// //若时间倒到0,定时器停止工作
// if (span.Ticks >= time * TimeSpan.TicksPerSecond)
// {
// btnStartPause.Enabled = false;
// timer1.Enabled = false;
// }
// else
// {
// DateTime spanDt = new DateTime(
// time * TimeSpan.TicksPerSecond - span.Ticks);
// label1.Text = spanDt.ToString("HH:mm:ss:fff");
// label2.Text = (time - span.TotalSeconds).ToString("00");
// }
// }
// else //正计时
// {
// DateTime spanDt = new DateTime(span.Ticks);
// label1.Text = spanDt.ToString("HH:mm:ss:fff");
// label2.Text = span.TotalSeconds.ToString("00");
// //误差测试,在正计时进行 --> 简单、方便:)
// iCount += timer1.Interval;
// label3.Text = (iCount / 1000).ToString("00");
// }
// }
// }
// }
//}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VizConnectC;
namespace DemoTool.Tool
{
/// <summary>
/// 表示vs与viz的一些联系操作
/// </summary>
class VizCommand
{
//实例化列表
public List<VizEnginePool> _poolList = new List<VizEnginePool>();
public List<bool> IsConnectVizList = new List<bool>();
public List<string> EnableIPList = new List<string>();
public VizEnginePool vizEnginePool = new VizEnginePool();
public string EnbleIPOne;
public bool IsConnectVizOne;
/// <summary>
/// 主备连接Viz
/// hostList表示连接的引擎的列表
/// </summary>
public void ConnectViz(List<string> IPlist)
{
_poolList.Clear();
EnableIPList.Clear();
//遍历
for (int i = 0; i < IPlist.Count; i++)
{
VizEnginePool _pool = new VizEnginePool();
bool IsConnectViz = false;//别处用来判断是否与引擎处于连接状态
_pool.Disconnect();
_pool.CleanRendererList();
_pool.AddRenderer(IPlist[i], 6100);
if (_pool.Connect())
{
IsConnectViz = true;
IsConnectVizOne = true;
EnableIPList.Add(IPlist[i]);
}
else
{
IsConnectViz = false;
}
IsConnectVizList.Add(IsConnectViz);
_poolList.Add(_pool);
}
}
/// <summary>
/// 单个连接Viz
/// hostList表示连接的引擎的列表
/// </summary>
public void ConnectOneViz(string IPlist)
{
//VizEnginePool _pool = new VizEnginePool();
bool IsConnectViz = false;//别处用来判断是否与引擎处于连接状态
vizEnginePool.Disconnect();
vizEnginePool.CleanRendererList();
vizEnginePool.AddRenderer(IPlist, 6100);
if (vizEnginePool.Connect())
{
IsConnectViz = true;
}
else
{
IsConnectViz = false;
}
IsConnectVizOne = IsConnectViz;
}
/// <summary>
/// 下场动画
/// </summary>
public void Continue()
{
for (int i = 0; i < _poolList.Count; i++)
{
if (_poolList[i].IsConnected)
{
_poolList[i].Send("RENDERER*STAGE CONTINUE");//播放动画
}
}
}
//加载场景发送数据
public void SendViz24(string data)
{
for (int i = 0; i < _poolList.Count; i++)
{
try
{
if (_poolList[i].IsConnected)
{
_poolList[i].Send("RENDERER SET_OBJECT SCENE*Arena/Scenes/VizArenaMain");
_poolList[i].Send("RENDERER*SCRIPT INVOKE Data " + "\"" + data + "\"");
//_poolList[i].Send("RENDERER*SCRIPT INVOKE GuangGao " + guangGaoPath);
//_poolList[i].Send("RENDERER*STAGE START");//播放动画
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
/// <summary>
/// 只发数据
/// </summary>
/// <param name="data"></param>
public void SendViz24Two(string data)
{
for (int i = 0; i < _poolList.Count; i++)
{
if (_poolList[i].IsConnected)
{
_poolList[i].Send("RENDERER*SCRIPT INVOKE Data " + "\"" + data + "\"");
}
}
}
}
}
{
"StudentInfo" :[
{
"uid": 19,
"nickname": "莫珉豪",
"score": 218,
"nationality": "波兰赛区",
"zone": "北京赛区",
"weigh": 1,
"rise": 1,
"rank": 1
},
{
"uid": 2,
"nickname": "丽莎",
"score": 222,
"nationality": "塔吉克斯坦赛区",
"zone": "北京赛区",
"weigh": 2,
"rise": 1,
"rank": 2
},
{
"uid": 3,
"nickname": "阮氏河银",
"score": 231,
"nationality": "越南-河内赛区",
"zone": "北京赛区",
"weigh": 3,
"rise": 1,
"rank": 3
},
{
"uid": 26,
"nickname": "高孜凯",
"score": 185,
"nationality": "美国-纽约赛区",
"zone": "北京赛区",
"weigh": 4,
"rise": 1,
"rank": 4
},
{
"uid": 24,
"nickname": "齐乐",
"score": 205,
"nationality": "巴西赛区",
"zone": "北京赛区",
"weigh": 5,
"rise": 0,
"rank": 5
}
]
}
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