C#代码,帮忙解释一下
namespace 机房管理系统{
public partial class myForm1 : Form
{
public myForm1()
{
InitializeComponent();//在每一个窗体生成的时候,都会针对于当前的窗体定义InitializeComponent()方法,该方法实际上是由系统生成的对于窗体界面的定义方法。
}
[DllImport("user32")]
private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
const int AW_HOR_POSITIVE = 0x0001;
const int AW_HOR_NEGATIVE = 0x0002;
const int AW_VER_POSITIVE = 0x0004;
const int AW_VER_NEGATIVE = 0x0008;
const int AW_CENTER = 0x0010;
const int AW_HIDE = 0x10000;
const int AW_ACTIVATE = 0x20000;
const int AW_SLIDE = 0x40000;
const int AW_BLEND = 0x80000;
bool isGuanliyuan = false;
string str011 = "";
string str012 = "";
string cmdtext1 = "net use H: /del ";
public string Gname = "";
private Point mouse_offset;
own_FClass owfm = new own_FClass();//创建新对象
string PwdStr = "";
public myForm1(string user) : this()
{
Gname = user; //管理员名
}
public myForm1(string m_Str, string _pwd):this()
{
richTextBox1.Text += m_Str;
PwdStr = _pwd;
}
#region 光标定位方法
/// <summary>
/// 光标定位到文本框末尾
/// </summary>
public void mousewh()
{
// 让光标定位到文本框末尾
richTextBox1.Select(richTextBox1.TextLength, 0);
//然后移动滚动条,使输入点(text entry point)(即光标所在的位置)显示出来
//这样也可以达到滚动到最下方的目的
richTextBox1.ScrollToCaret();
}
#endregion
#region 获取中文星期方法
/// <summary>
///获取中文星期,如:星期日
/// </summary>
string CaculateWeekDay(DateTime da)
{
string[] WeekStr = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
string week = WeekStr[Convert.ToInt16(da.DayOfWeek)];
return week;
}
#endregion
//定义获取路径方法
string Mydirectory(string str)
{
string str0 = System.AppDomain.CurrentDomain.BaseDirectory;
str0 += "flash\\" + str;
return str0;
}
public void setUser(string userName) //设置用户
{
//用户上机
textBox2.Text = userName;
own_FClass owfm = new own_FClass();
string str01 = "";
string str02 = "";
string str001 = "";
string str002 = "";
int remainTime = 0;
str02 = "select * from 机房上机信息 where 卡号='" + textBox2.Text + "'";
str01 = "update 机房上机信息 set 当前状态='上机',上机时间=getDate() where 卡号='" + textBox2.Text + "'";