Init commit.

This commit is contained in:
椰子 2019-09-14 20:12:26 +08:00
parent 23af3add8b
commit 7be5cefcd3
64 changed files with 1925 additions and 0 deletions

BIN
.vs/NJCIT/v15/.suo Normal file

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

25
NJCIT.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.779
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NJCIT", "NJCIT\NJCIT.csproj", "{A862BD45-8733-40D8-92B0-0F2239486648}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A862BD45-8733-40D8-92B0-0F2239486648}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A862BD45-8733-40D8-92B0-0F2239486648}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A862BD45-8733-40D8-92B0-0F2239486648}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A862BD45-8733-40D8-92B0-0F2239486648}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F2EF0563-75E0-499D-9C95-5B54DE9CA4CC}
EndGlobalSection
EndGlobal

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

10
NJCIT/App.config Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

169
NJCIT/InfomationForm.Designer.cs generated Normal file
View File

@ -0,0 +1,169 @@
namespace NJCIT
{
partial class InfomationForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InfomationForm));
this.button_logout = new System.Windows.Forms.Button();
this.label_info = new System.Windows.Forms.Label();
this.label_username = new System.Windows.Forms.Label();
this.label_domain = new System.Windows.Forms.Label();
this.label_ip = new System.Windows.Forms.Label();
this.label_timer = new System.Windows.Forms.Label();
this.label_account = new System.Windows.Forms.Label();
this.label_timeamount = new System.Windows.Forms.Label();
this.button_exit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button_logout
//
this.button_logout.Cursor = System.Windows.Forms.Cursors.Hand;
this.button_logout.Location = new System.Drawing.Point(60, 290);
this.button_logout.Name = "button_logout";
this.button_logout.Size = new System.Drawing.Size(90, 40);
this.button_logout.TabIndex = 2;
this.button_logout.Text = "退出登录";
this.button_logout.UseVisualStyleBackColor = true;
this.button_logout.Click += new System.EventHandler(this.Button_Logout_Click);
//
// label_info
//
this.label_info.AutoSize = true;
this.label_info.Location = new System.Drawing.Point(85, 30);
this.label_info.Name = "label_info";
this.label_info.Size = new System.Drawing.Size(149, 20);
this.label_info.TabIndex = 9;
this.label_info.Text = "登录状态:用户未登录";
//
// label_username
//
this.label_username.AutoSize = true;
this.label_username.Location = new System.Drawing.Point(85, 65);
this.label_username.Name = "label_username";
this.label_username.Size = new System.Drawing.Size(132, 20);
this.label_username.TabIndex = 10;
this.label_username.Text = "用 户 名 xueye.io";
//
// label_domain
//
this.label_domain.AutoSize = true;
this.label_domain.Location = new System.Drawing.Point(85, 100);
this.label_domain.Name = "label_domain";
this.label_domain.Size = new System.Drawing.Size(130, 20);
this.label_domain.TabIndex = 11;
this.label_domain.Text = "认 证 域 internet";
//
// label_ip
//
this.label_ip.AutoSize = true;
this.label_ip.Location = new System.Drawing.Point(85, 135);
this.label_ip.Name = "label_ip";
this.label_ip.Size = new System.Drawing.Size(117, 20);
this.label_ip.TabIndex = 12;
this.label_ip.Text = "登 录 IP 0.0.0.0";
//
// label_timer
//
this.label_timer.AutoSize = true;
this.label_timer.Location = new System.Drawing.Point(85, 170);
this.label_timer.Name = "label_timer";
this.label_timer.Size = new System.Drawing.Size(125, 20);
this.label_timer.TabIndex = 13;
this.label_timer.Text = "在线时长0:00:00";
//
// label_account
//
this.label_account.AutoSize = true;
this.label_account.Location = new System.Drawing.Point(85, 205);
this.label_account.Name = "label_account";
this.label_account.Size = new System.Drawing.Size(101, 20);
this.label_account.TabIndex = 14;
this.label_account.Text = "账户余额0元";
//
// label_timeamount
//
this.label_timeamount.AutoSize = true;
this.label_timeamount.Location = new System.Drawing.Point(85, 240);
this.label_timeamount.Name = "label_timeamount";
this.label_timeamount.Size = new System.Drawing.Size(145, 20);
this.label_timeamount.TabIndex = 15;
this.label_timeamount.Text = "已用时长0时0分0秒";
//
// button_exit
//
this.button_exit.Cursor = System.Windows.Forms.Cursors.Hand;
this.button_exit.Location = new System.Drawing.Point(200, 290);
this.button_exit.Name = "button_exit";
this.button_exit.Size = new System.Drawing.Size(90, 40);
this.button_exit.TabIndex = 1;
this.button_exit.Text = "关闭程序";
this.button_exit.UseVisualStyleBackColor = true;
this.button_exit.Click += new System.EventHandler(this.Button_exit_Click);
//
// InfomationForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(334, 351);
this.Controls.Add(this.button_exit);
this.Controls.Add(this.label_timeamount);
this.Controls.Add(this.label_account);
this.Controls.Add(this.label_timer);
this.Controls.Add(this.label_ip);
this.Controls.Add(this.label_domain);
this.Controls.Add(this.label_username);
this.Controls.Add(this.label_info);
this.Controls.Add(this.button_logout);
this.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximizeBox = false;
this.Name = "InfomationForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "登录信息";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InfomationForm_FormClosing);
this.Load += new System.EventHandler(this.InformationForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button_logout;
private System.Windows.Forms.Label label_info;
private System.Windows.Forms.Label label_username;
private System.Windows.Forms.Label label_domain;
private System.Windows.Forms.Label label_ip;
private System.Windows.Forms.Label label_timer;
private System.Windows.Forms.Label label_account;
private System.Windows.Forms.Label label_timeamount;
private System.Windows.Forms.Button button_exit;
}
}

141
NJCIT/InfomationForm.cs Normal file
View File

@ -0,0 +1,141 @@
using System;
using System.Collections;
using System.Threading;
using System.Windows.Forms;
namespace NJCIT
{
public partial class InfomationForm : Form
{
public Thread updateThread;
private bool tag = true;
public InfomationForm()
{
InitializeComponent();
}
private void InformationForm_Load(object sender, EventArgs e)
{
this.ChangeForm();
this.UpdateInfomation();
CheckForIllegalCrossThreadCalls = false;
StartTimer();
}
private void Button_Logout_Click(object sender, EventArgs e)
{
DialogResult r = MessageBox.Show("确定要退出登录吗?", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (r == DialogResult.OK)
{
LoginServer.DoLogout();
if (LoginServer.Online)
{
MessageBox.Show("退出登录失败!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
this.ChangeForm();
}
}
}
private void Button_exit_Click(object sender, EventArgs e)
{
this.StopTimer();
Environment.Exit(0);
}
public void UpdateInfomation()
{
ArrayList result = LoginServer.GetInformation();
if (result.Count == 7)
{
label_info.Text = "登录状态:" + result[0].ToString();
label_username.Text = "用 户 名 " + result[1].ToString();
label_domain.Text = "认 证 域 " + result[2].ToString();
label_ip.Text = "登 录 IP " + result[3].ToString();
label_timer.Text = "已用时长:" + FormatTime1(result[4].ToString());
label_account.Text = "账户余额:" + result[5].ToString() + "元";
label_timeamount.Text = "已用时长:" + FormatTime2(result[6].ToString());
}
}
// 切换窗体
private void ChangeForm()
{
this.Hide();
new LoginForm(this).ShowDialog();
}
private static String FormatTime2(string timeStr)
{
long time = 0;
try
{
time = long.Parse(timeStr);
}
catch (Exception)
{
time = 0;
}
long second = time % 60;
time = time / 60;
long minute = time % 60;
time = time / 60;
long hour = time % 60;
return hour + "小时" + minute + "分" + second + "秒";
}
private static String FormatTime1(string timeStr)
{
long time = 0;
try
{
time = long.Parse(timeStr);
}
catch (Exception)
{
time = 0;
}
long second = time % 60;
time = time / 60;
long minute = time % 60;
time = time / 60;
long hour = time % 60;
return hour + ":" + minute + ":" + second;
}
public void StartTimer()
{
updateThread = new Thread(new ThreadStart(ThreadMethod));
updateThread.Start();
}
public void StopTimer()
{
tag = false;
}
private void ThreadMethod()
{
while (tag)
{
UpdateInfomation();
Thread.Sleep(1000);
}
}
// 处理退出操作
private void InfomationForm_FormClosing(object sender, FormClosingEventArgs e)
{
StopTimer();
Environment.Exit(0);
}
public void GetFocus()
{
button_exit.Focus();
}
}
}

227
NJCIT/InfomationForm.resx Normal file
View File

@ -0,0 +1,227 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="button_logout.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_info.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_username.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_domain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_ip.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_timer.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_account.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="label_timeamount.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="button_exit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAHQSAAB0EgAAAAAAAAAA
AAAAAAAAAAAAAAfB/w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AAAwAAAA4AAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAgAAAAcAAAAM=
</value>
</data>
</root>

185
NJCIT/LoginForm.Designer.cs generated Normal file
View File

@ -0,0 +1,185 @@
namespace NJCIT
{
partial class LoginForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm));
this.Label_Username = new System.Windows.Forms.Label();
this.Label_Domain = new System.Windows.Forms.Label();
this.Label_Password = new System.Windows.Forms.Label();
this.TextBox_Username = new System.Windows.Forms.TextBox();
this.ComboBox_Domain = new System.Windows.Forms.ComboBox();
this.TextBox_Password = new System.Windows.Forms.TextBox();
this.CheckBox_AutoLogin = new System.Windows.Forms.CheckBox();
this.CheckBox_Remember = new System.Windows.Forms.CheckBox();
this.Button_Login = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// Label_Username
//
this.Label_Username.AutoSize = true;
this.Label_Username.Location = new System.Drawing.Point(75, 38);
this.Label_Username.Name = "Label_Username";
this.Label_Username.Size = new System.Drawing.Size(65, 20);
this.Label_Username.TabIndex = 0;
this.Label_Username.Text = "用户名:";
//
// Label_Domain
//
this.Label_Domain.AutoSize = true;
this.Label_Domain.Location = new System.Drawing.Point(75, 94);
this.Label_Domain.Name = "Label_Domain";
this.Label_Domain.Size = new System.Drawing.Size(65, 20);
this.Label_Domain.TabIndex = 0;
this.Label_Domain.Text = "认证域:";
//
// Label_Password
//
this.Label_Password.AutoSize = true;
this.Label_Password.Location = new System.Drawing.Point(75, 150);
this.Label_Password.Name = "Label_Password";
this.Label_Password.Size = new System.Drawing.Size(63, 20);
this.Label_Password.TabIndex = 0;
this.Label_Password.Text = "密 码:";
//
// TextBox_Username
//
this.TextBox_Username.Location = new System.Drawing.Point(150, 38);
this.TextBox_Username.MaxLength = 16;
this.TextBox_Username.Name = "TextBox_Username";
this.TextBox_Username.Size = new System.Drawing.Size(155, 25);
this.TextBox_Username.TabIndex = 1;
this.TextBox_Username.TextChanged += new System.EventHandler(this.TextBox_UserName_TextChanged);
this.TextBox_Username.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBox_Username_KeyDown);
//
// ComboBox_Domain
//
this.ComboBox_Domain.BackColor = System.Drawing.SystemColors.Window;
this.ComboBox_Domain.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ComboBox_Domain.FormattingEnabled = true;
this.ComboBox_Domain.Items.AddRange(new object[] {
"student-phone",
"student"});
this.ComboBox_Domain.Location = new System.Drawing.Point(150, 94);
this.ComboBox_Domain.MaxDropDownItems = 5;
this.ComboBox_Domain.Name = "ComboBox_Domain";
this.ComboBox_Domain.Size = new System.Drawing.Size(155, 28);
this.ComboBox_Domain.TabIndex = 2;
this.ComboBox_Domain.SelectedIndexChanged += new System.EventHandler(this.ComboBox_Domain_SelectedIndexChanged);
//
// TextBox_Password
//
this.TextBox_Password.Location = new System.Drawing.Point(150, 150);
this.TextBox_Password.Name = "TextBox_Password";
this.TextBox_Password.Size = new System.Drawing.Size(155, 25);
this.TextBox_Password.TabIndex = 3;
this.TextBox_Password.UseSystemPasswordChar = true;
this.TextBox_Password.TextChanged += new System.EventHandler(this.TextBox_Password_TextChanged);
this.TextBox_Password.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBox_Password_KeyDown);
//
// CheckBox_AutoLogin
//
this.CheckBox_AutoLogin.AutoSize = true;
this.CheckBox_AutoLogin.Cursor = System.Windows.Forms.Cursors.Hand;
this.CheckBox_AutoLogin.Location = new System.Drawing.Point(90, 205);
this.CheckBox_AutoLogin.Name = "CheckBox_AutoLogin";
this.CheckBox_AutoLogin.Size = new System.Drawing.Size(84, 24);
this.CheckBox_AutoLogin.TabIndex = 4;
this.CheckBox_AutoLogin.Text = "自动登录";
this.CheckBox_AutoLogin.UseVisualStyleBackColor = true;
this.CheckBox_AutoLogin.CheckedChanged += new System.EventHandler(this.CheckBox_AutoLogin_CheckedChanged);
this.CheckBox_AutoLogin.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CheckBox_AutoLogin_KeyDown);
//
// CheckBox_Remember
//
this.CheckBox_Remember.AutoSize = true;
this.CheckBox_Remember.Cursor = System.Windows.Forms.Cursors.Hand;
this.CheckBox_Remember.Location = new System.Drawing.Point(220, 205);
this.CheckBox_Remember.Name = "CheckBox_Remember";
this.CheckBox_Remember.Size = new System.Drawing.Size(84, 24);
this.CheckBox_Remember.TabIndex = 5;
this.CheckBox_Remember.Text = "记住密码";
this.CheckBox_Remember.UseVisualStyleBackColor = true;
this.CheckBox_Remember.CheckedChanged += new System.EventHandler(this.CheckBox_Remember_CheckedChanged);
this.CheckBox_Remember.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CheckBox_Remember_KeyDown);
//
// Button_Login
//
this.Button_Login.Cursor = System.Windows.Forms.Cursors.Hand;
this.Button_Login.Location = new System.Drawing.Point(80, 255);
this.Button_Login.Name = "Button_Login";
this.Button_Login.Size = new System.Drawing.Size(230, 40);
this.Button_Login.TabIndex = 6;
this.Button_Login.Text = "登录";
this.Button_Login.UseVisualStyleBackColor = true;
this.Button_Login.Click += new System.EventHandler(this.Button_Login_Click);
//
// LoginForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(384, 311);
this.Controls.Add(this.Label_Domain);
this.Controls.Add(this.ComboBox_Domain);
this.Controls.Add(this.Button_Login);
this.Controls.Add(this.CheckBox_Remember);
this.Controls.Add(this.CheckBox_AutoLogin);
this.Controls.Add(this.Label_Password);
this.Controls.Add(this.Label_Username);
this.Controls.Add(this.TextBox_Password);
this.Controls.Add(this.TextBox_Username);
this.Cursor = System.Windows.Forms.Cursors.Default;
this.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "LoginForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "校园网登录";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LoginForm_FormClosing);
this.Load += new System.EventHandler(this.LoginForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox TextBox_Username;
private System.Windows.Forms.TextBox TextBox_Password;
private System.Windows.Forms.Label Label_Username;
private System.Windows.Forms.CheckBox CheckBox_AutoLogin;
private System.Windows.Forms.CheckBox CheckBox_Remember;
private System.Windows.Forms.Button Button_Login;
private System.Windows.Forms.ComboBox ComboBox_Domain;
private System.Windows.Forms.Label Label_Domain;
private System.Windows.Forms.Label Label_Password;
}
}

240
NJCIT/LoginForm.cs Normal file
View File

@ -0,0 +1,240 @@
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace NJCIT
{
public partial class LoginForm : Form
{
private static bool isAutoLogin = false;
private static bool isRemember = true;
private static string path = "./config.ini";
private static int domain;
private static string userName;
private static string password;
private Form mainForm;
public LoginForm(Form form)
{
this.mainForm = form;
InitializeComponent();
}
// 窗口载入时执行的操作
private void LoginForm_Load(object sender, EventArgs e)
{
ReadConfig();
// 检查用户在线状态
if (!LoginServer.Logouted)
{
if (LoginServer.Online)
{
//MessageBox.Show("用户已登录", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
ChangeForm();
}
else if(isAutoLogin)
{
this.AutoLogin();
}
}
}
// 用户名
private void TextBox_UserName_TextChanged(object sender, EventArgs e)
{
userName = TextBox_Username.Text;
}
// 认证域
private void ComboBox_Domain_SelectedIndexChanged(object sender, EventArgs e)
{
domain = ComboBox_Domain.SelectedIndex; ;
}
// 密码
private void TextBox_Password_TextChanged(object sender, EventArgs e)
{
password = StringToBase64(TextBox_Password.Text);
}
// 自动登录按钮
private void CheckBox_AutoLogin_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox_AutoLogin.Checked)
{
CheckBox_Remember.Checked = true;
}
}
//保存密码按钮
private void CheckBox_Remember_CheckedChanged(object sender, EventArgs e)
{
if (!CheckBox_Remember.Checked)
{
CheckBox_AutoLogin.Checked = false;
}
}
// 登录按钮
private void Button_Login_Click(object sender, EventArgs e)
{
if (TextBox_Username.Text.Length == 0)
{
MessageBox.Show("用户名不能为空!", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
TextBox_Username.Focus();
return;
}
if (TextBox_Password.Text.Length == 0)
{
MessageBox.Show("密码不能为空!", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
TextBox_Password.Focus();
return;
}
this.AutoLogin();
}
private void TextBox_Username_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
Button_Login.PerformClick();
}
}
private void TextBox_Password_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
Button_Login.PerformClick();
}
}
private void CheckBox_AutoLogin_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
Button_Login.PerformClick();
}
}
private void CheckBox_Remember_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
Button_Login.PerformClick();
}
}
private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (!LoginServer.Online)
{
Environment.Exit(0);
}
}
// 登录操作
private void AutoLogin()
{
LoginServer.DoLogin(userName, domain, password);
if (LoginServer.Online)
{
this.ChangeForm();
WriteConfig();
}
else
{
ArrayList list = LoginServer.GetInformation();
if (list == null)
{
MessageBox.Show("登录失败,请检查您的互联网连接状态!", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
MessageBox.Show(list[0].ToString(), "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
// 切换窗体
private void ChangeForm()
{
this.mainForm.Show();
this.Close();
}
// 编码转换
private static string StringToBase64(string str)
{
byte[] bytes = Encoding.ASCII.GetBytes(str);
return Convert.ToBase64String(bytes, 0, bytes.Length);
}
// 编码转换
private static string Base64ToString(string str)
{
try
{
byte[] bytes = Convert.FromBase64String(str);
return Encoding.ASCII.GetString(bytes);
}
catch (Exception)
{
return "";
}
}
// 读取配置
private void ReadConfig()
{
// 读取配置
if (!File.Exists(path))
{
try
{
File.Create(path).Close();
}
catch (Exception)
{
}
}
isAutoLogin = OperateIniFile.ReadIniData("Settings", "AutoLogin", "0", path).Equals("1") ? true : false;
isRemember = OperateIniFile.ReadIniData("Settings", "SavePassword", "1", path).Equals("1") ? true : false;
try
{
domain = Int32.Parse(OperateIniFile.ReadIniData("Account", "Domain", "0", path));
}
catch (Exception)
{
domain = 0;
}
userName = OperateIniFile.ReadIniData("Account", "UserName", "", path);
password = OperateIniFile.ReadIniData("Account", "Password", "", path);
CheckBox_AutoLogin.Checked = isAutoLogin;
CheckBox_Remember.Checked = isRemember;
TextBox_Username.Text = userName;
ComboBox_Domain.SelectedIndex = domain;
TextBox_Password.Text = Base64ToString(password);
}
// 保存配置
private void WriteConfig()
{
isAutoLogin = CheckBox_AutoLogin.Checked;
isRemember = CheckBox_Remember.Checked;
userName = TextBox_Username.Text;
domain = ComboBox_Domain.SelectedIndex;
password = StringToBase64(TextBox_Password.Text);
OperateIniFile.WriteIniData("Settings", "AutoLogin", isAutoLogin ? "1" : "0", path);
OperateIniFile.WriteIniData("Settings", "SavePassword", isRemember ? "1" : "0", path);
OperateIniFile.WriteIniData("Account", "UserName", userName, path);
OperateIniFile.WriteIniData("Account", "Domain", domain.ToString(), path);
OperateIniFile.WriteIniData("Account", "Password", isRemember ? password : "", path);
}
}
}

227
NJCIT/LoginForm.resx Normal file
View File

@ -0,0 +1,227 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Label_Username.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label_Domain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label_Password.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="TextBox_Username.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ComboBox_Domain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="TextBox_Password.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="CheckBox_AutoLogin.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="CheckBox_Remember.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Button_Login.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAHQSAAB0EgAAAAAAAAAA
AAAAAAAAAAAAAAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB
/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB
/wAAAAAAAAAAAAAAAAAHwf8AB8H/AAfB/wAHwf8aB8H/XAfB/4MHwf+GB8H/hQfB/4UHwf+FB8H/hQfB
/4UHwf+FB8H/hQfB/4UHwf+FB8H/hQfB/4UHwf+FB8H/hQfB/4UHwf+FB8H/hQfB/4UHwf+EB8H/YQfB
/x4Hwf8AB8H/AAfB/wAAAAAAB8H/AAfB/wAHwf8AB8H/TwfB/88Hwf/9B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf/+B8H/1gfB/1sHwf8CB8H/AAfB/wAHwf8AB8H/AAfB/0wHwf/qB8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H/8QfB/1sHwf8AB8H/AAfB/wAHwf8VB8H/yQfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//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fB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H/hQfB/wAHwf8AB8H/hQfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8L//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf+GB8H/AAfB/wAHwf94B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB/4MHwf8AB8H/AAfB/0sHwf/5B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf/9B8H/XAfB/wAHwf8AB8H/EQfB/8EHwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB/88Hwf8aB8H/AAfB/wAHwf8AB8H/QQfB
/+MHwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf/qB8H/TwfB/wAHwf8AB8H/AAfB
/wAHwf8AB8H/QQfB/8EHwf/5B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB
//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf//B8H//wfB//8Hwf/6B8H/yQfB/0wHwf8AB8H/AAfB
/wAAAAAAB8H/AAfB/wAHwf8AB8H/EQfB/0sHwf94B8H/hQfB/4UHwf+FB8H/hQfB/4UHwf+FB8H/hQfB
/4UHwf+FB8H/hQfB/4UHwf+FB8H/hQfB/4UHwf+FB8H/hQfB/4UHwf+FB8H/egfB/1AHwf8VB8H/AAfB
/wAHwf8AAAAAAAAAAAAAAAAAB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB
/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB/wAHwf8AB8H/AAfB
/wAHwf8AB8H/AAAAAAAAAAAAwAAAA4AAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAgAAAAcAAAAM=
</value>
</data>
</root>

131
NJCIT/LoginServer.cs Normal file
View File

@ -0,0 +1,131 @@
using System;
using System.Collections;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
namespace NJCIT
{
class LoginServer
{
private static readonly string[] domainStr = new string[] { "studentphone", "student" };
private static readonly string initURL = "http://n.njcit.cn/index.php/index/init";
private static readonly string logoutURL = "http://n.njcit.cn/index.php/index/logout";
private static ArrayList result = null;
public static bool Online = false;
public static bool Logouted = false;
// 静态初始化
static LoginServer()
{
UpdateResult(HttpConect(initURL));
}
// 获取登录信息
public static ArrayList GetInformation()
{
UpdateResult(HttpConect(initURL));
return result;
}
// 执行登录
public static void DoLogin(string username, int domain, string password)
{
string[] textArray = new string[] { "http://n.njcit.cn/index.php/index/login?username=", username, "&domain=" + domainStr[domain] + "&password=", password, "&enablemacauth=1" };
UpdateResult(HttpConect(string.Concat(textArray)));
}
// 退出登录
public static void DoLogout()
{
UpdateResult(HttpConect(logoutURL));
Logouted = true;
}
// 处理登录返回结果
private static void UpdateResult(string str)
{
if (str != null)
{
string[] strArray = str.Replace("{", "").Replace("}", "").Replace("\"", "").Split(new char[] { ',' });
if (strArray != null)
{
ArrayList list = new ArrayList();
if (strArray.Length == 3)
{
list.Add("认证失败, 请检查密码及账户状态!");
Online = false;
}
else if (strArray.Length == 1)
{
list.Add("认证失败,账户已锁定!");
Online = false;
}
else if (strArray.Length == 4)
{
list.Add("认证失败,并发登录超过最大限制!");
Online = false;
}
else
{
list.Add("用户已登录");
if (strArray.Length == 11)
{
list.Add(ParseData(strArray[2]));
list.Add(ParseData(strArray[3]));
list.Add(ParseData(strArray[4]));
list.Add(ParseData(strArray[6]));
list.Add(ParseData(strArray[8]));
list.Add(ParseData(strArray[9]));
}
else
{
list.Add(ParseData(strArray[2]));
list.Add(ParseData(strArray[3]));
list.Add(ParseData(strArray[4]));
list.Add(ParseData(strArray[6]));
list.Add(ParseData(strArray[9]));
list.Add(ParseData(strArray[10]));
}
Online = true;
}
result = list;
}
}
}
// Http连接
private static string HttpConect(string URL)
{
Ping ping = new Ping();
PingReply reply = ping.Send("n.njcit.cn", 1000);
if (reply.Status != IPStatus.Success)
{
return null;
}
try
{
WebClient client = new WebClient
{
Credentials = CredentialCache.DefaultCredentials
};
byte[] bytes = client.DownloadData(URL);
return Encoding.UTF8.GetString(bytes);
}
catch (Exception)
{
return null;
}
}
// 解析数据
private static string ParseData(string str)
{
char[] separator = new char[] { ':' };
return str.Split(separator)[1];
}
}
}

137
NJCIT/NJCIT.csproj Normal file
View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A862BD45-8733-40D8-92B0-0F2239486648}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>NJCIT</RootNamespace>
<AssemblyName>NJCIT</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>keyhole_64px_1210130_easyicon.net.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LoginServer.cs" />
<Compile Include="InfomationForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="InfomationForm.Designer.cs">
<DependentUpon>InfomationForm.cs</DependentUpon>
</Compile>
<Compile Include="LoginForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LoginForm.Designer.cs">
<DependentUpon>LoginForm.cs</DependentUpon>
</Compile>
<Compile Include="OperateIniFile.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="LoginForm.resx">
<DependentUpon>LoginForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="InfomationForm.resx">
<DependentUpon>InfomationForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="config.ini" />
<None Include="Properties\DataSources\NJCIT.Properties.Resources.datasource" />
<None Include="Properties\DataSources\NJCIT.Properties.Settings.datasource" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="20190912030906111_easyicon_net_64.ico" />
<Content Include="keyhole_64px_1210130_easyicon.net.ico" />
<Content Include="locked_with_key_64px_1215152_easyicon.net.ico" />
<Content Include="preferences_system_login_32px_572066_easyicon.net.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

13
NJCIT/NJCIT.csproj.user Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

73
NJCIT/OperateIniFile.cs Normal file
View File

@ -0,0 +1,73 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace NJCIT
{
public class OperateIniFile
{
#region API函数声明
[DllImport("kernel32")] //返回0表示失败非0为成功
private static extern long WritePrivateProfileString(string section, string key,
string val, string filePath);
[DllImport("kernel32")] //返回取得字符串缓冲区的长度
private static extern long GetPrivateProfileString(string section, string key,
string def, StringBuilder retVal, int size, string filePath);
#endregion
/// <summary>
/// 读Ini文件
/// </summary>
/// <param name="Section">[]内的段落名</param>
/// <param name="Key">key</param>
/// <param name="NoText"></param>
/// NoText对应API函数的def参数它的值由用户指定是当在配置文件中没有找到具体的Value时就用NoText的值来代替。可以为空
/// <param name="iniFilePath">ini配置文件的路径加ini文件名</param>
/// <returns></returns>
#region Ini文件
public static string ReadIniData(string Section, string Key, string NoText, string iniFilePath)
{
if (File.Exists(iniFilePath))
{
StringBuilder temp = new StringBuilder(1024);
GetPrivateProfileString(Section, Key, NoText, temp, 1024, iniFilePath);
return temp.ToString();
}
else
{
return String.Empty;
}
}
#endregion
#region Ini文件
public static bool WriteIniData(string Section, string Key, string Value, string iniFilePath)
{
if (File.Exists(iniFilePath))
{
long OpStation = WritePrivateProfileString(Section, Key, Value, iniFilePath);
if (OpStation == 0)
{
return false;
}
else
{
return true;
}
}
else
{
return false;
}
}
#endregion
}
}

19
NJCIT/Program.cs Normal file
View File

@ -0,0 +1,19 @@
using System;
using System.Windows.Forms;
namespace NJCIT
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new InfomationForm());
}
}
}

View File

@ -0,0 +1,39 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("南信校园网登录工具")]
[assembly: AssemblyDescription("南信校园网登录工具")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("叶神")]
[assembly: AssemblyProduct("NJCIT")]
[assembly: AssemblyCopyright("Copyright © 2019 叶神")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a862bd45-8733-40d8-92b0-0f2239486648")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("zh-CN")]

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Resources" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NJCIT.Properties.Resources, NJCIT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Settings" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NJCIT.Properties.Settings, NJCIT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

63
NJCIT/Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace NJCIT.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NJCIT.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

26
NJCIT/Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace NJCIT.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

BIN
NJCIT/bin/Debug/NJCIT.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

BIN
NJCIT/bin/Debug/NJCIT.pdb Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
[Settings]
AutoLogin=1
SavePassword=1
[Account]
username=305895
password=OTkwMTIx
domain=0

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

BIN
NJCIT/bin/Release/NJCIT.pdb Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
[Settings]
AutoLogin=0
SavePassword=1
[Account]
UserName=305895
Domain=0
Password=OTkwMTIx

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
de566e741e2d21f59948c22cf09d298ed912688f

View File

@ -0,0 +1,10 @@
C:\Users\xueye\source\repos\NJCIT\NJCIT\bin\Debug\NJCIT.exe.config
C:\Users\xueye\source\repos\NJCIT\NJCIT\bin\Debug\NJCIT.exe
C:\Users\xueye\source\repos\NJCIT\NJCIT\bin\Debug\NJCIT.pdb
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.LoginForm.resources
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.InfomationForm.resources
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.Properties.Resources.resources
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.csproj.GenerateResource.cache
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.csproj.CoreCompileInputs.cache
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.exe
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Debug\NJCIT.pdb

Binary file not shown.

Binary file not shown.

BIN
NJCIT/obj/Debug/NJCIT.exe Normal file

Binary file not shown.

BIN
NJCIT/obj/Debug/NJCIT.pdb Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
de566e741e2d21f59948c22cf09d298ed912688f

View File

@ -0,0 +1,10 @@
C:\Users\xueye\source\repos\NJCIT\NJCIT\bin\Release\NJCIT.exe.config
C:\Users\xueye\source\repos\NJCIT\NJCIT\bin\Release\NJCIT.exe
C:\Users\xueye\source\repos\NJCIT\NJCIT\bin\Release\NJCIT.pdb
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.LoginForm.resources
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.InfomationForm.resources
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.Properties.Resources.resources
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.csproj.GenerateResource.cache
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.csproj.CoreCompileInputs.cache
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.exe
C:\Users\xueye\source\repos\NJCIT\NJCIT\obj\Release\NJCIT.pdb

Binary file not shown.

BIN
NJCIT/obj/Release/NJCIT.exe Normal file

Binary file not shown.

BIN
NJCIT/obj/Release/NJCIT.pdb Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB