91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 54KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-09
  • 語言: C#
  • 標簽:

資源簡介

實現C#將txt里面的內容按照特殊格式與特殊符號分割并存入數組中,再進行讀取,讀取特定內容后面的文字。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
/*
?首先新建txt文件?:F:\\Movie1.txt,寫入一下內容:
?
1:這是“1”后面的數據1這是“1”后面的數據2這是“1”后面的數據3
2:這是“2”后面的數據1這是“2”后面的數據2這是“2”后面的數據3
3:這是“3”后面的數據1這是“3”后面的數據2這是“3”后面的數據3

實現內容是先按照“:”將123后面的數據全部放入二維數組的dic[][]的一維中,再根據后面的“,”將數據放入其二維中。
?*/
using?System.IO;
namespace?WindowsFormsApplication1
{
????public?partial?class?Form1?:?Form
????{
????????Dictionary?dic?=?new?Dictionary();
????????List?listKeys?=?new?List();

????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????//List?list_Get?=?Read(“F:\\TestTxt.txt“);
????????????List?list_Get?=?Read(“F:\\Movie1.txt“);?//讀取txt文件內容并賦給list_Get內
????????????foreach?(string?s?in?list_Get)
????????????{
????????????????string[]?arr?=?s.Split(‘:‘);
????????????????listKeys.Add(arr[0]);
????????????????string[]?arr_value?=?arr[1].Split(‘‘);
????????????????dic.Add(arr[0]?arr_value);
????????????}
????????????this.comboBox1.DataSource?=?listKeys;?
???????????//?AA.Text?=?listKeys[1];
???????????//?BB.Text?=?dic[“1“][0];
????????}
????????public?List?Read(string?path)
????????{
????????????StreamReader?sr?=?new?StreamReader(path?Encoding.Default);
????????????string?line;
????????????List?list?=?new?List();
????????????while?((line?=?sr.ReadLine())?!=?null)
????????????{
????????????????list.Add(line.ToString());
????????????}
????????????return?list;
????????}


????????private?void?comboBox1_SelectedIndexChanged_1(object?sender?EventArgs?e)
????????{
????????????string?key?=?comboBox1.SelectedItem.ToString();
????????????this.textBox1.Text?=?dic[key][0];
????????????this.textBox2.Text?=?dic[key][1];
????????????this.textBox3.Text?=?dic[key][2];
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\
?????文件?????????914??2015-01-03?17:07??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1.sln
?????文件???????24576??2015-11-20?23:50??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1.suo
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\bin\
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
?????文件???????10752??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
?????文件???????28160??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
?????文件???????11600??2015-11-20?23:50??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
?????文件?????????490??2010-03-17?22:39??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
?????文件????????2379??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
?????文件????????5088??2015-11-20?23:27??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
?????文件????????5817??2015-11-20?23:17??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\
?????目錄???????????0??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\
?????文件????????4501??2015-01-03?17:23??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6584??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????1448??2015-11-20?23:17??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.read.1.tlog
?????文件????????3398??2015-11-20?23:17??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\GenerateResource.write.1.tlog
?????文件????????8031??2015-01-03?17:24??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\ResolveAssemblyReference.cache
?????目錄???????????0??2015-01-03?17:07??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\TempPE\
?????文件????????5126??2015-11-20?23:50??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
?????文件???????10752??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe
?????文件?????????180??2015-11-20?23:17??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Form1.resources
?????文件???????28160??2015-11-20?23:49??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb
?????文件?????????180??2015-11-20?23:03??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources
?????文件?????????505??2015-01-03?17:07??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs
?????目錄???????????0??2015-11-10?21:40??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\Properties\
?????文件????????1398??2015-01-03?17:07??c#?讀取txt文件中特定內容后的文字\WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs
............此處省略5個文件信息

評論

共有 條評論

相關資源