資源簡介
這是和C#相關的 課程設計 代碼。運行于Visual Studio 2008

代碼片段和文件信息
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;
namespace?stuBJTZ
{
????public?partial?class?Form1?:?Form
????{
????????bool?flag?=?true;
????????bool?BJ=false?;
????????string?strDirCur?=?System.Environment.CurrentDirectory.ToString()?+?“\\班級通知“;
????????string[]?indexArray?=?new?string[500];
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????if?(this.Opacity?>?0.6?&&?flag)
????????????????this.Opacity?-=?0.0001;
????????????else
????????????????flag?=?false;
????????????if?(this.Opacity?1.0&&!flag?)
????????????????this.Opacity?+=?0.0001;
????????????else
????????????????flag?=?true;
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????this.timer1.Enabled?=?true;
????????????label1.Text?=?“Cla\n???ss“;
????????????label2.Text?=?“M?e“;
????????????label3.Text?=?“age:“;
????????????label4.Text?=?“???標\n???題:“;
????????????textBox1.Focus();
????????????DirectoryInfo?dir?=?new?DirectoryInfo(strDirCur);
????????????FileInfo[]?files?=?new?FileInfo[500];
????????????files?=?dir.GetFiles(“*.txt“);
????????????int?i?j?=?0;
????????????int?numf?=?0;
????????????foreach?(FileInfo?f?in?files)
????????????{
????????????????i?=f.Name.LastIndexOf(“_“);
????????????????listBox1.Items.Add(f.Name?.Substring?(0i));
????????????????j?=f.Name.LastIndexOf(“.“);
????????????????indexArray[numf++]?=?f.Name.Substring(i+1j-i-1);
????????????}
????????}
????????private?void?pictureBox4_Click(object?sender?EventArgs?e)
????????{
????????????string?fileName=““;
????????????if?(textBox1.Text?==?““)
????????????{
????????????????MessageBox.Show(“消息標題不能為空!!“);
????????????????return;
????????????}
????????????if?(richTextBox1.Text?==?““)
????????????{
????????????????MessageBox.Show(“班級消息框不能為空!!“);
????????????????return;
????????????}
????????????fileName?=?strDirCur?+?“\\“?+?textBox1.Text?+?“___“?+?comboBox1.Text+“_“+DateTime?.Now?.Year?+“年“+DateTime?.Now?.Month?+“月“+DateTime?.Now?.Day?+“日“?+DateTime?.Now?.Hour?+“時“+DateTime?.Now??.Minute?+“分“+DateTime?.Now?.Second?+“秒“+?“.txt“;
????????????StreamWriter?strWr?=?new?StreamWriter(fileName);
????????????try
????????????{
????????????????strWr.WriteLine(richTextBox1.Text);
????????????????MessageBox.Show(“發布成功!!“);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????MessageBox.Show(ex.Message);
????????????}
????????????finally
????????????{
????????????????strWr.Close();
????????????}
????????????BJ?=?true;
????????}
????????private?void?pictureBox6_Click(object?sender?EventArgs?e)
????????{
????????????richTextBox1.Clear();
????????????textBox1.Text?=?““;
????????????textBox1.Focus();
????????}
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????180224??2012-01-25?09:49??stuBJTZ\stuBJTZ\bin\Debug\stuBJTZ.exe
?????文件??????42496??2012-01-25?09:49??stuBJTZ\stuBJTZ\bin\Debug\stuBJTZ.pdb
?????文件??????14328??2012-01-25?09:49??stuBJTZ\stuBJTZ\bin\Debug\stuBJTZ.vshost.exe
?????文件????????490??2009-06-11?05:14??stuBJTZ\stuBJTZ\bin\Debug\stuBJTZ.vshost.exe.manifest
?????文件??????????8??2011-04-27?23:25??stuBJTZ\stuBJTZ\bin\Debug\班級通知\13456___緊急_2011年4月27日23時25分28秒.txt
?????文件??????????8??2011-04-27?23:26??stuBJTZ\stuBJTZ\bin\Debug\班級通知\廳___普通_2011年4月27日23時26分11秒.txt
?????文件???????5961??2010-06-17?20:16??stuBJTZ\stuBJTZ\Form1.cs
?????文件??????20236??2010-06-17?20:16??stuBJTZ\stuBJTZ\Form1.Designer.cs
?????文件??????10331??2010-06-17?20:16??stuBJTZ\stuBJTZ\Form1.resx
?????文件???????2252??2012-01-25?09:49??stuBJTZ\stuBJTZ\obj\Debug\stuBJTZ.csproj.FileListAbsolute.txt
?????文件???????1265??2010-06-17?20:16??stuBJTZ\stuBJTZ\obj\Debug\stuBJTZ.csproj.GenerateResource.Cache
?????文件?????180224??2012-01-25?09:49??stuBJTZ\stuBJTZ\obj\Debug\stuBJTZ.exe
?????文件???????3116??2012-01-25?09:49??stuBJTZ\stuBJTZ\obj\Debug\stuBJTZ.Form1.resources
?????文件??????42496??2012-01-25?09:49??stuBJTZ\stuBJTZ\obj\Debug\stuBJTZ.pdb
?????文件?????158444??2012-01-25?09:49??stuBJTZ\stuBJTZ\obj\Debug\stuBJTZ.Properties.Resources.resources
?????文件???????5632??2010-06-14?22:28??stuBJTZ\stuBJTZ\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件????????488??2010-06-14?18:35??stuBJTZ\stuBJTZ\Program.cs
?????文件???????1346??2010-06-14?18:35??stuBJTZ\stuBJTZ\Properties\AssemblyInfo.cs
?????文件???????5220??2010-06-14?22:28??stuBJTZ\stuBJTZ\Properties\Resources.Designer.cs
?????文件???????8251??2010-06-14?22:28??stuBJTZ\stuBJTZ\Properties\Resources.resx
?????文件???????1092??2010-06-14?18:35??stuBJTZ\stuBJTZ\Properties\Settings.Designer.cs
?????文件????????249??2010-06-14?18:35??stuBJTZ\stuBJTZ\Properties\Settings.settings
?????文件??????11766??2010-06-14?20:44??stuBJTZ\stuBJTZ\Resources\071703010962341.gif
?????文件??????13342??2010-06-14?18:39??stuBJTZ\stuBJTZ\Resources\071703012961000.gif
?????文件??????19250??2010-06-14?22:26??stuBJTZ\stuBJTZ\Resources\2620.png
?????文件??????15215??2010-06-14?21:23??stuBJTZ\stuBJTZ\Resources\26230.png
?????文件??????21852??2010-06-14?22:21??stuBJTZ\stuBJTZ\Resources\265.png
?????文件???????3549??2010-06-14?18:37??stuBJTZ\stuBJTZ\Resources\31.jpg
?????文件??????17056??2010-06-14?18:41??stuBJTZ\stuBJTZ\Resources\6244517122007t.gif
?????文件???????7502??2010-06-14?22:23??stuBJTZ\stuBJTZ\Resources\social_twitter_retweet.png
............此處省略17個文件信息
- 上一篇:C#獲取串口名稱
- 下一篇:秦皇島煤價預測.csv
評論
共有 條評論