資源簡介
簡單初級的人員隨機分組及抽簽工具及源碼,由VS2010編寫,可用于人員隨機分組和人員隨機順序抽簽。抓鬮分組。
代碼片段和文件信息
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;
using?System.IO;
using?System.Configuration;
using?System.Text.Regularexpressions;
using?System.Threading;
namespace?隨機分組工具
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????string[]?zuyua?=?new?string[200];
????????string[]?fenzu?=?new?string[200];
????????public?static?string?tianjia?=?““;
????????public?static?System.Data.DataTable?dtzuyuan?=?new?System.Data.DataTable();
????????int?ci?=?0;
????????int?yuanze?=?2;
????????private?System.Data.DataTable?GetTxt(string?pths)
????????{
????????????StreamReader?sr?=?new?StreamReader(pths?Encoding.GetEncoding(“GB2312“));
????????????string?txt?=?sr.ReadToEnd().Replace(“\r\n“?“*“);
????????????string[]?nodes?=?txt.Split(‘*‘);
????????????//#endregion
????????????//#region?填充DataTable
????????????System.Data.DataTable?dt?=?new?System.Data.DataTable();
????????????//dt.Columns.Add(“ID“?typeof(string));
????????????dt.Columns.Add(“地址“?typeof(string));
????????????dt.Columns.Add(“勾選“?typeof(string));
????????????foreach?(string?node?in?nodes)
????????????{
????????????????try
????????????????{
????????????????????string[]?strs?=?node.Split(‘&‘);
????????????????????DataRow?dr?=?dt.NewRow();
????????????????????//dr[“ID“]?=?strs[0];
????????????????????dr[“地址“]?=?strs[0];
????????????????????dr[“勾選“]?=?strs[1];
????????????????????dt.Rows.Add(dr);
????????????????}
????????????????catch
????????????????{
????????????????}
????????????}
????????????//#endregion
????????????sr.Close();
????????????return?dt;
????????}
????????public?static?void?writeTxt(string?pths?System.Data.DataTable?dt)
????????{
????????????string?path?=?pths;
????????????StringBuilder?builder?=?new?StringBuilder();
????????????//builder.AppendLine(dt.Columns[0].ColumnName?+?‘/‘?+?dt.Columns[1].ColumnName?+?‘/‘?+?dt.Columns[2].ColumnName?+?‘/‘?+?dt.Columns[3].ColumnName);
????????????foreach?(DataRow?dr?in?dt.Rows)
????????????{
????????????????builder.AppendLine(dr[0].ToString()?+?‘&‘?+?dr[1].ToString());
????????????????using?(System.IO.FileStream?file?=?new?System.IO.FileStream(path?System.IO.FileMode.Create?System.IO.FileAccess.Write))
????????????????{
????????????????????using?(System.IO.TextWriter?text?=?new?System.IO.StreamWriter(file?System.Text.Encoding.Default))
????????????????????{
????????????????????????text.Write(builder.ToString());
????????????????????}
????????????????}
????????????}
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????if?(File.Exists(System.Windows.Forms.Application.StartupPath?+?@“\分組源表.txt“))
????????????{
????????????????string?adress?=?System.Windows.Forms.Application.StartupPath?+?@“\分組源表.txt“;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????80??2019-01-31?14:38??隨機分組工具\隨機分組工具\bin\Debug\分組源表.txt
?????文件?????153088??2018-03-02?10:08??隨機分組工具\隨機分組工具\bin\Debug\抓鬮工具.exe
?????文件??????38400??2018-03-02?10:08??隨機分組工具\隨機分組工具\bin\Debug\抓鬮工具.pdb
?????文件??????11608??2018-10-08?15:43??隨機分組工具\隨機分組工具\bin\Debug\抓鬮工具.vshost.exe
?????文件????????490??2016-03-09?13:48??隨機分組工具\隨機分組工具\bin\Debug\抓鬮工具.vshost.exe.manifest
?????文件??????16384??2018-03-01?17:18??隨機分組工具\隨機分組工具\bin\Debug\隨機分組工具.exe
?????文件??????40448??2018-03-01?17:18??隨機分組工具\隨機分組工具\bin\Debug\隨機分組工具.pdb
?????文件????????490??2016-03-09?13:48??隨機分組工具\隨機分組工具\bin\Debug\隨機分組工具.vshost.exe.manifest
?????文件???????8789??2018-03-02?10:08??隨機分組工具\隨機分組工具\Form1.cs
?????文件???????8442??2018-03-01?17:30??隨機分組工具\隨機分組工具\Form1.Designer.cs
?????文件?????107783??2018-03-01?17:30??隨機分組工具\隨機分組工具\Form1.resx
?????文件??????67646??2018-03-01?17:30??隨機分組工具\隨機分組工具\green_shell_128px_12736_easyicon.net.ico
?????文件???????1229??2018-03-02?09:03??隨機分組工具\隨機分組工具\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6314??2018-03-02?10:08??隨機分組工具\隨機分組工具\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????4608??2018-03-01?17:30??隨機分組工具\隨機分組工具\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件?????153088??2018-03-02?10:08??隨機分組工具\隨機分組工具\obj\x86\Debug\抓鬮工具.exe
?????文件??????38400??2018-03-02?10:08??隨機分組工具\隨機分組工具\obj\x86\Debug\抓鬮工具.pdb
?????文件????????180??2018-03-01?17:30??隨機分組工具\隨機分組工具\obj\x86\Debug\抓鬮工具.Properties.Resources.resources
?????文件???????2114??2018-10-08?15:43??隨機分組工具\隨機分組工具\obj\x86\Debug\隨機分組工具.csproj.FileListAbsolute.txt
?????文件???????1040??2018-03-01?17:30??隨機分組工具\隨機分組工具\obj\x86\Debug\隨機分組工具.csproj.GenerateResource.Cache
?????文件???????1757??2018-03-02?09:21??隨機分組工具\隨機分組工具\obj\x86\Debug\隨機分組工具.csprojResolveAssemblyReference.cache
?????文件??????68212??2018-03-01?17:30??隨機分組工具\隨機分組工具\obj\x86\Debug\隨機分組工具.Form1.resources
?????文件????????180??2018-03-01?15:08??隨機分組工具\隨機分組工具\obj\x86\Debug\隨機分組工具.Properties.Resources.resources
?????文件????????180??2018-03-01?17:30??隨機分組工具\隨機分組工具\obj\x86\Debug\隨機分組工具.添加成員.resources
?????文件????????499??2018-03-01?14:44??隨機分組工具\隨機分組工具\Program.cs
?????文件???????1386??2018-03-01?14:44??隨機分組工具\隨機分組工具\Properties\AssemblyInfo.cs
?????文件???????2864??2018-03-01?17:30??隨機分組工具\隨機分組工具\Properties\Resources.Designer.cs
?????文件???????5612??2018-03-01?14:44??隨機分組工具\隨機分組工具\Properties\Resources.resx
?????文件???????1112??2018-03-01?17:30??隨機分組工具\隨機分組工具\Properties\Settings.Designer.cs
?????文件????????249??2018-03-01?14:44??隨機分組工具\隨機分組工具\Properties\Settings.settings
............此處省略19個文件信息
評論
共有 條評論