Commit db23a30e by mahaisong

feat:csv读取,下一步加入调用ES,导出JSON功能。

parent 1a78ef03

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsvCount_ES", "CsvCount_ES\CsvCount_ES.csproj", "{AEA53B87-526A-4945-8BFC-25D19FE5EBA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AEA53B87-526A-4945-8BFC-25D19FE5EBA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEA53B87-526A-4945-8BFC-25D19FE5EBA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEA53B87-526A-4945-8BFC-25D19FE5EBA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEA53B87-526A-4945-8BFC-25D19FE5EBA1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{AEA53B87-526A-4945-8BFC-25D19FE5EBA1}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CsvCount_ES</RootNamespace>
<AssemblyName>CsvCount_ES</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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="System" />
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="ListModel.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.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="hive_export .csv" />
<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>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<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>
\ No newline at end of file
namespace CsvCount_ES
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox_path = new System.Windows.Forms.TextBox();
this.label_wait = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// button1
//
this.button1.Location = new System.Drawing.Point(432, 40);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "1.选择文件";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(76, 40);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(350, 20);
this.textBox1.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 2;
this.label1.Text = "文件路径:";
//
// button2
//
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(76, 80);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(99, 27);
this.button2.TabIndex = 3;
this.button2.Text = "2:开始执行分析";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 153);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 5;
this.label2.Text = "执行日志:";
//
// listBox1
//
this.listBox1.Enabled = false;
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(76, 122);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(431, 160);
this.listBox1.TabIndex = 8;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(3, 331);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(106, 13);
this.label3.TabIndex = 9;
this.label3.Text = "执行结果存储文件:";
//
// textBox_path
//
this.textBox_path.Enabled = false;
this.textBox_path.Location = new System.Drawing.Point(115, 331);
this.textBox_path.Name = "textBox_path";
this.textBox_path.Size = new System.Drawing.Size(517, 20);
this.textBox_path.TabIndex = 10;
//
// label_wait
//
this.label_wait.AutoSize = true;
this.label_wait.Location = new System.Drawing.Point(220, 87);
this.label_wait.Name = "label_wait";
this.label_wait.Size = new System.Drawing.Size(0, 13);
this.label_wait.TabIndex = 11;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 371);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(239, 13);
this.label4.TabIndex = 12;
this.label4.Text = "参考:1.800W条记录不查ES,20秒统计次数";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(644, 408);
this.Controls.Add(this.label4);
this.Controls.Add(this.label_wait);
this.Controls.Add(this.textBox_path);
this.Controls.Add(this.label3);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.button2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox_path;
private System.Windows.Forms.Label label_wait;
private System.Windows.Forms.Label label4;
}
}
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CsvCount_ES
{
public partial class Form1 : Form
{
//key:newsid字段,也是itemid字段,value:int-次数累计
private ConcurrentDictionary<string, int> totalCountDic = new ConcurrentDictionary<string, int>();
//链式结构 key: Int64 累加(对应分块的块号), value:这一块的ListModel的第一行和最后一行的string内容
private ConcurrentDictionary<Int64, ListModel> listModelDic = new ConcurrentDictionary<Int64, ListModel>();
private static Int64 sn = 0;
//警告 在 32 位 Intel 计算机上分配 64 位值不是原子操作;即该操作不是线程安全的。这意味着,如果两个人同时将一个值分配给一个静态 Int64 字段,则该字段的最终值是无法预测的。
/// <summary>
/// 得到编号加1的值
/// </summary>
/// <returns></returns>
public static Int64 ADD()
{
//新建线程,线程数加一
return Interlocked.Increment(ref sn);
}
public Form1()
{
InitializeComponent();
this.listBox1.HorizontalScrollbar = true;
this.openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
this.openFileDialog1.Filter = "数据文件|*.csv";
}
private void button1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
button2.Enabled = true;
listBox1.Items.Clear();
textBox_path.Text = "";
label_wait.Text = "尚未开始执行!";
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
ListControl ls = (ListControl)sender;
MessageBox.Show(ls.Text);
}
int count = 0;
int errorCount = 0;
private void button2_Click(object sender, EventArgs e)
{
Stopwatch st = new Stopwatch();
st.Start();
if (!String.IsNullOrWhiteSpace(textBox1.Text))
{
#region 执行内存映射方案
label_wait.Text = "正在执行分析,请耐心等待........!";
button1.Enabled = false;
textBox1.Enabled = false;
button2.Enabled = false;
listBox1.Enabled = true;
Application.DoEvents();
//输出测试
//for (int i = 0; i < 500; i++)
//{
// //跨线程访问
// this.BeginInvoke(new MethodInvoker(delegate ()
// {
// count = count + 1;
// this.listBox1.SuspendLayout();
// this.listBox1.Items.Add("开始:" + count.ToString() + "————————————————————————————————结束");
// this.listBox1.ResumeLayout();
// Application.DoEvents();
// }));
//}
string filepath = openFileDialog1.FileName;
setup:
try
{
#region 基本用法--820W行数据,439MB,转成字符串、split后,执行消耗14~15秒。
////读取文件
//FileInfo fi = new FileInfo(filepath);
//Int64 size = fi.Length;//byte长度
//int offset = 0;
//int length = 512000;//每次块大小 512000byte 500KB 这样1个G转2010次算完
////UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。
//string fp2 = @filepath;
//using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname"))
//{
// using (var accessor = mmf.CreateViewAccessor(offset, size))
// {
// List<string> list = new List<string>();
// //每隔100是1行
// for (int i = 0; i < size; i += length)
// {
// byte[] byteArray = new byte[length];
// //ReadArray参数
// //position
// //Type: System.Int64
// //访问器中的字节偏移量,从此处开始读取。
// //array
// //Type: T[]
// //包含从访问器读取的结构的数组。
// //offset
// //Type: System.Int32
// //array 中要将第一个复制的结构放置到的索引。
// //count
// //Type: System.Int32
// //要从访问器读取的 T 类型的结构的数目。
// //resultcount:读入 array 的结构数。 如果可用结构较少,则此值可能小于 count;如果到达访问器末尾,则为零。
// int resultcount = accessor.ReadArray(i, byteArray, 0, length);
// //\r\n 空格 \n 都测试通过
// //\r 空格 \n 都算1个字符 规则:最后必须是\n结尾
// string str = System.Text.Encoding.Default.GetString(byteArray);
// int index = str.LastIndexOf('\n');
// string[] k = str.Split();
// count = count + k.Length;
// if (str.Length==index)
// {
// //最后一行可以分析
// }
// else
// {
// //str.IndexOf
// //不相等,最后一行不能分析。
// //spilt时,将最后一行保存起来,本次处理索引-1。
// //头条保存起来,也不处理,本次处理索引-2。(标志是否是第一条,异步时,第一个肯定是完整的,不需要存入)
// }
// }
// }
//}
#endregion
//读取文件
FileInfo fi = new FileInfo(filepath);
Int64 size = fi.Length;//byte长度
int offset = 0;
int length = 512000;//每次块大小 512000byte 500KB 这样1个G转2010次算完
//UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。
string fp2 = @filepath;
using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname"))
{
using (var accessor = mmf.CreateViewAccessor(offset, size))
{
List<string> list = new List<string>();
//每隔100是1行
for (int i = 0; i < size; i += length)
{
Int64 listkey = ADD();
byte[] byteArray = new byte[length];
#region 函数参数说明
//ReadArray参数
//position
//Type: System.Int64
//访问器中的字节偏移量,从此处开始读取。
//array
//Type: T[]
//包含从访问器读取的结构的数组。
//offset
//Type: System.Int32
//array 中要将第一个复制的结构放置到的索引。
//count
//Type: System.Int32
//要从访问器读取的 T 类型的结构的数目。
//resultcount:读入 array 的结构数。 如果可用结构较少,则此值可能小于 count;如果到达访问器末尾,则为零。
#endregion
int resultcount = accessor.ReadArray(i, byteArray, 0, length);
//测试通过:\r\n \r 空格 \n(注意:\r 空格 \n 都算1个字符,\r\n算2个字符)
//规则:最后必须是\n结尾,cvs的换行都是\n结尾。
string str = System.Text.Encoding.Default.GetString(byteArray);
int index = str.LastIndexOf('\n');
string[] k = str.Split('\n');
string endstr = null;
if (str.Length != index)
{
//不相等,最后一行不能Split分析。
//spilt时,将最后一行保存起来,本次处理索引-1。
//头条保存起来,也不处理,本次处理索引-2。
endstr = k[k.Count() - 1].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(); ;
}
//else
//{
// //最后一行可以Split分析,不再处理
//}
//先简化开发,将头部和尾部都另外保存。只计算中间的。然后调用ES (索引-2:从1开始,尾部-1)
//测试: 820W条记录,执行完毕 20~ 22秒。 最终结果3w2013条记录。有的直接点击3000多次。
for (int j = 1; j < k.Count() - 1; j++)
{
try
{
string key = k[j].Split(',')[1].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim();
totalCountDic.AddOrUpdate(key, 0, (skey, scount) => { return scount = scount + 1; });
}
catch (Exception ext)
{
MessageBox.Show("某行数据第2列可能为空" + ext.ToString());
}
}
//头尾:另外保存
ListModel listmodel = new ListModel(k[0].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(), endstr);
listModelDic.TryAdd(listkey, listmodel);
}
}
}
if (listModelDic.Count() > 0)
{
if (listModelDic.Count() == 1)
{
try
{
string key = listModelDic[1].End;
if(!String.IsNullOrWhiteSpace(key))
totalCountDic.AddOrUpdate(listModelDic[1].End.Split(',')[1], 0, (skey, scount) => { return scount = scount + 1; });
}
catch (Exception ext)
{
MessageBox.Show("只有一块时(文件小):第一行数据第2列可能为空" + ext.ToString());
}
}
else
{
//头尾单独链式处理: 从1开始。第0行的begin 是列名称,不需要分析。
//注意这里是用i标识key,而key是从1开始的,i=2,i-1就等于1,即,key=1的值。同理。listModelDic.Count()+1为901,i为900时,计算899end和900的begin。
for (int i = 2; i < listModelDic.Count() + 1; i++)
{
try
{
count = count + 1;//记录计算了多少次,与分块对应(其实就是与listModelDic的key-1对应即代表完整)
string str = "";
if (!String.IsNullOrWhiteSpace(listModelDic[i - 1].End))
{
//上一个的end+本轮的begin拼接,不需要去除/n
str = listModelDic[i - 1].End + listModelDic[i].Begin;
}
else
{
//上一个的end(为空)+本轮的begin拼接,不需要去除/n
str = listModelDic[i].Begin;
}
string key = str.Split(',')[1];
totalCountDic.AddOrUpdate(key, 0, (skey, scount) => { return scount = scount + 1; });
}
catch (Exception ext)
{
MessageBox.Show("头尾单独链式处理:某行数据第2列可能为空" + ext.ToString());
}
}
//最后补充最后一条的end 是没有换行了。所以不需要处理。肯定为null。 keyend.end 是空字符串。
//object keyend = listModelDic[listModelDic.Count()];
}
}
}
catch (IOException ex)
{
errorCount = errorCount + 1;
if (errorCount > 2)
{
MessageBox.Show(ex.ToString());
errorCount = 0;
}
else
{
//遇到csv无法文件无法使用时,通过修改扩展名实现。
filepath = Path.ChangeExtension(filepath, ".txt");
//个别CSV\ppt\word等文件类型,则必须强转为任何其他类型的文本后缀结构。否则MemoryMappedFile不识别.
goto setup;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
#endregion
st.Stop();
MessageBox.Show("运行时间:" + st.ElapsedMilliseconds.ToString());
#region 完整性测试---使用时注释掉。
try
{
//通过一行行的输入,最终获得1个列表B,以B为左,求差集
ConcurrentDictionary<string, int> BtotalCountDic = new ConcurrentDictionary<string, int>();
#region 按行读取代码
//读取文件
Stopwatch swtp = new Stopwatch();
swtp.Start();
count = 0;
StreamReader sr = new StreamReader(filepath, Encoding.Default);
String line;
line = sr.ReadLine();//第一行,头部列名称,不进入集合
while ((line = sr.ReadLine()) != null)
{
try
{
count = count + 1;//记录计算了多少次,与分块对应(其实就是与listModelDic的key-1对应即代表完整)
string key = line.Split(',')[1];
BtotalCountDic.AddOrUpdate(key, 0, (skey, scount) => { return scount = scount + 1; });
}
catch (Exception ext)
{
MessageBox.Show("完整性测试:某行数据第2列可能为空" + ext.ToString());
}
}
swtp.Stop();
MessageBox.Show("完整性测试运行时间:" + swtp.ElapsedMilliseconds.ToString());
#endregion
//全比较
var dz1 = BtotalCountDic.Except(totalCountDic);
//key比较
var dz2 = BtotalCountDic.Keys.Except(totalCountDic.Keys);
if (null == dz1.First() && null == dz2.First())
{
//两个方式结果一致。
}
else
{
MessageBox.Show("完整性测试报错" );
}
}
catch (Exception exe1)
{
MessageBox.Show("完整性测试" + exe1.ToString());
}
#endregion
}
else
{
MessageBox.Show("请选择文件夹!");
}
#region 执行完成
label_wait.Text = "执行完毕!";
this.textBox_path.Text = "文件路径";
//listBox1.Enabled = false;
textBox1.Enabled = true;
button1.Enabled = true;
MessageBox.Show("结果行数:" + count.ToString());
errorCount = 0;
count = 0;
#endregion
}
}
}
<?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="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsvCount_ES
{
public class ListModel
{
//链式结构的定义:
//Begin结构的头部第一行保留(初始为空,执行后一定不为空)
//假如:是集合内第一条,异步时,第一个肯定是完整的,不需要分析前后关系
string begin =null;
//End结构的尾部最后一行保留(初始为空,如果结尾不是换行符则填入,结尾是换行符则为空)
string end = null;
public string Begin
{
get
{
return begin;
}
set
{
begin = value;
}
}
public string End
{
get
{
return end;
}
set
{
end = value;
}
}
public ListModel()
{
}
public ListModel(string begin, string end)
{
Begin = begin;
End = end;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CsvCount_ES
{
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("CsvCount_ES")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CsvCount_ES")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("aea53b87-526a-4945-8bfc-25d19fe5eba1")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [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 CsvCount_ES.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("CsvCount_ES.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 CsvCount_ES.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>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.exe.config
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.exe
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.pdb
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Form1.resources
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Properties.Resources.resources
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csproj.GenerateResource.Cache
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.exe
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.pdb
C:\Users\admin\documents\visual studio 2015\Projects\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csprojResolveAssemblyReference.cache
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.exe.config
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.exe
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.pdb
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.exe
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.pdb
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csprojResolveAssemblyReference.cache
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Form1.resources
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Properties.Resources.resources
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csproj.GenerateResource.Cache
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