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

  • 大小: 80KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-03
  • 語言: C#
  • 標(biāo)簽: c#??xml??數(shù)據(jù)庫??

資源簡介

實(shí)現(xiàn)了XML文件的讀寫,與傳統(tǒng)的讀寫方式不一樣,采用的是XML序列化的讀寫方式,先將xml轉(zhuǎn)化成List,再進(jìn)行增刪改,非常方便。

資源截圖

代碼片段和文件信息

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;
using?System.Runtime.Serialization;
using?System.Runtime.Serialization.Json;
using?System.xml.Serialization;

namespace?WinFormNoteBook
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????public?string?FilePath=“d:note.xml“;
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????NoteType?noteType?=?new?NoteType
????????????{
????????????????ID?=?new?Guid(“2d1c47b6-e0d0-4aa8-bfe4-c1bedd30827c“)
????????????????Name?=?“分類1“
????????????????Description?=?“這是分類“
????????????????SortCode?=?“1“
????????????};
????????????//構(gòu)造數(shù)據(jù)
????????????List?noteList?=?new?List
????????????{
????????????????new?Note?{ID=Guid.NewGuid()Name=“陳大“SortCode=“1“NoteTypeName=noteType.NameNoteTypeID=noteType.ID?}
????????????????new?Note?{ID=Guid.NewGuid()Name=“王大“SortCode=“2“NoteTypeName=noteType.NameNoteTypeID=noteType.ID?}
????????????????new?Note?{ID=Guid.NewGuid()Name=“李大“SortCode=“3“NoteTypeName=noteType.NameNoteTypeID=noteType.ID?}
????????????????new?Note?{ID=Guid.NewGuid()Name=“阿大“SortCode=“4“?NoteTypeName=noteType.NameNoteTypeID=noteType.ID?}
????????????};
????????????for?(int?i?=?0;?i?????????????{
????????????????var?bo?=?new?Note?{?ID?=?Guid.NewGuid()?Name?=?“陳大“+i?SortCode?=?“1“?NoteTypeName?=?noteType.Name?NoteTypeID?=?noteType.ID?};
????????????????noteList.Add(bo);?
????????????}
????????????for?(int?i?=?1;?i?????????????{
????????????????cbPageSize.Items.Add(i*10);
????????????}

?????????
????????????noteType.Notes?=?noteList;
????????????//寫進(jìn)文件
????????????//var?jsonStr=?ToJson(noteType);?
????????????//?WriteFile(FilePath?jsonStr);
????????????WritexmlFile(noteType);
????????????//讀取文件
????????????//??jsonStr?=?ReadFile(“d:note.txt“);
????????????//var?data=?Toobject(jsonStr);
????????????//int?pageIndex?=?1;
????????????//int?pageSize?=?2;
????????????//var?boColl?=?gotoPage(1);
????????????////初始化頁數(shù)
????????????//for?(int?i?=?1;?i?????????????//{
????????????//????cbPages.Items.Add(i);
????????????//}
????????????initPageItem(1);
????????????gvData.CurrentCell?=?null;
????????
????????
???????????
????????}
????????public?void?initPageItem(int?pageIndex)
????????{
????????????var?boColl?=?gotoPage(pageIndex);
????????????if?(boColl.Count?==?0)
????????????{
????????????????pageIndex--;
????????????????if?(pageIndex?!=?0)?
????????????????boColl?=?gotoPage(pageIndex);
????????????}
????????????//初始化頁數(shù)
????????????//?cbPages.Items.Clear();
????????????var?pageItemList?=?new?List();
????????????for?(int?i?=?1;?i?

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-06-04?14:45??xml\
?????文件?????????184??2016-05-23?09:47??xml\App.config
?????文件???????14739??2016-05-22?16:11??xml\Form1.Designer.cs
?????文件???????20396??2016-05-22?16:46??xml\Form1.cs
?????文件????????5817??2016-05-22?16:11??xml\Form1.resx
?????文件?????????527??2016-05-18?20:47??xml\Program.cs
?????目錄???????????0??2016-06-04?14:45??xml\Properties\
?????文件????????1338??2016-05-18?20:47??xml\Properties\AssemblyInfo.cs
?????文件????????2870??2016-05-23?09:47??xml\Properties\Resources.Designer.cs
?????文件????????5612??2016-05-18?20:47??xml\Properties\Resources.resx
?????文件????????1115??2016-05-23?09:47??xml\Properties\Settings.Designer.cs
?????文件?????????249??2016-05-18?20:47??xml\Properties\Settings.settings
?????文件????????4102??2016-05-23?09:47??xml\WinFormNoteBook.csproj
?????文件?????????998??2016-05-23?09:54??xml\WinFormNoteBook.sln
?????文件???????12288??2016-05-23?09:54??xml\WinFormNoteBook.v12.suo
?????目錄???????????0??2016-06-04?14:45??xml\bin\
?????目錄???????????0??2016-06-04?14:45??xml\bin\Debug\
?????文件???????24576??2016-05-23?09:47??xml\bin\Debug\WinFormNoteBook.exe
?????文件?????????184??2016-05-23?09:47??xml\bin\Debug\WinFormNoteBook.exe.config
?????文件???????42496??2016-05-23?09:47??xml\bin\Debug\WinFormNoteBook.pdb
?????文件???????24224??2016-05-23?09:53??xml\bin\Debug\WinFormNoteBook.vshost.exe
?????文件?????????184??2016-05-23?09:47??xml\bin\Debug\WinFormNoteBook.vshost.exe.config
?????文件?????????490??2012-06-02?22:34??xml\bin\Debug\WinFormNoteBook.vshost.exe.manifest
?????目錄???????????0??2016-06-04?14:45??xml\obj\
?????目錄???????????0??2016-06-04?14:45??xml\obj\Debug\
?????文件????????1464??2016-05-19?22:55??xml\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????7272??2016-05-23?09:47??xml\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2016-06-04?14:45??xml\obj\Debug\TempPE\
?????文件????????4608??2016-05-23?09:47??xml\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件???????????0??2016-05-18?20:47??xml\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件???????????0??2016-05-18?20:47??xml\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
............此處省略8個(gè)文件信息

評論

共有 條評論