infomd.cs
来自「学生学籍管理系统 学生管理 教材管理 成绩管理」· CS 代码 · 共 58 行
CS
58 行
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.IO;
namespace 学籍管理系统
{
public partial class infomd : DevComponents.DotNetBar .Office2007Form
{
public infomd()
{
InitializeComponent();
}
private void info_Load(object sender, EventArgs e)
{
string paths = Directory.GetCurrentDirectory() + "\\log.txt";
FileStream sour = new FileStream(paths, FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamReader sr = new StreamReader(sour, Encoding.Default);
string sline = null;
ArrayList alist = new ArrayList();
while (sr.Peek() != -1)
{
sline = sr.ReadLine();
alist.Add(sline);
}
string[] arrtet = new string[alist.Count];
alist.CopyTo(arrtet, 0);
listBox1.Items.AddRange(arrtet);
sr.Close();
}
private void buttonX1_Click(object sender, EventArgs e)
{
this.Close();
}
private void buttonX2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
string paths = Directory.GetCurrentDirectory() + "\\log.txt";
StreamWriter sw = new StreamWriter(paths, false, Encoding.Default);
sw.WriteLine();
sw.Close();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?