⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winboard.cs

📁 一个即时通信 Messenger C#代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
/*

<Aicaca Community Messenger Client>

Copyright (c) Aicaca.com, All rights reserved.

Writer                : Byung-ku, Cho (Aicaca)
E-mail                : aicaca@hanmail.net
Personal Homepage URL : http://www.aicaca.com
Last Updated Date     : Feb. 27th, 2002

Programming Language  : C#
Editor & Compiler     : VisualStudio.NET

*/


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Data;
using System.Threading;
using System.Runtime.Serialization.Formatters.Binary;

namespace TalkClient
{
    delegate void GridDelegate();

	public class WinBoard : System.Windows.Forms.Form
	{
		private WinCom WC = new WinCom();
		private WinClient xWinClient;

        private string rootID;
		private string localID;

		private string boardID;
		private string boardName;
		private string boardPassword;
		private string boardType;

		private string msgID;
		private string msgPassword;

		private enum ActionMode {Msg, Write, Modify, Reply}
		private ActionMode actionMode = new ActionMode();

		private string searchKeyword;
		private string searchType;

        private DataTable xDataTable = new DataTable("board");
		private GridDelegate xGridDelegate;

		private System.Windows.Forms.Panel listPanel;
		private System.Windows.Forms.GroupBox actionGroup;
		private System.Windows.Forms.Button writeButton;
		private System.Windows.Forms.DataGrid mainGrid;
		private System.Windows.Forms.Panel inputPanel;
		private System.Windows.Forms.GroupBox bottomGroup;
		private System.Windows.Forms.Label msgLabel;
		private System.Windows.Forms.Label pwdLabel;
		private System.Windows.Forms.Label emailLabel;
		private System.Windows.Forms.Label writerLabel;
		private System.Windows.Forms.Label titleLabel;
		private System.Windows.Forms.TextBox titleBox;
		private System.Windows.Forms.TextBox writerBox;
		private System.Windows.Forms.TextBox pwdBox;
		private System.Windows.Forms.RichTextBox msgBox;
		private System.Windows.Forms.TextBox emailBox;
		private System.Windows.Forms.GroupBox topGroup;
		private System.Windows.Forms.TextBox countBox;
		private System.Windows.Forms.Label countLabel;
		private System.Windows.Forms.Button listButton;
		private System.Windows.Forms.Button saveButton;
		private System.Windows.Forms.Button resetButton;
		private System.Windows.Forms.Button replyButton;
		private System.Windows.Forms.Button modifyButton;
		private System.Windows.Forms.Button deleteButton;
		private System.Windows.Forms.DataGridTableStyle tableStyle;
		private System.Windows.Forms.DataGridTextBoxColumn titleStyle;
		private System.Windows.Forms.DataGridTextBoxColumn writerStyle;
		private System.Windows.Forms.DataGridTextBoxColumn emailStyle;
		private System.Windows.Forms.DataGridTextBoxColumn hitStyle;
		private System.Windows.Forms.DataGridTextBoxColumn dateStyle;
		private System.Windows.Forms.DataGridTextBoxColumn idStyle;
		private System.Windows.Forms.DataGridTextBoxColumn stepStyle;
		private System.Windows.Forms.Button adminButton;
		private System.Windows.Forms.GroupBox searchGroup;
		private System.Windows.Forms.TextBox searchBox;
		private System.Windows.Forms.Button searchButton;
		private System.Windows.Forms.Button allButton;
		private System.Windows.Forms.ComboBox typeCombo;
		private System.Windows.Forms.Label uploadLabel;
		private System.Windows.Forms.TextBox uploadBox;
		private System.Windows.Forms.Button uploadButton;
		private System.Windows.Forms.OpenFileDialog openDialog;
		private System.Windows.Forms.DataGridTextBoxColumn uploadStyle;
		private System.Windows.Forms.SaveFileDialog saveDialog;
		private System.Windows.Forms.ContextMenu editMenu;
		private System.ComponentModel.Container components = null;

		public WinBoard(WinClient tWinClient, string tLocalID, string tRootID, string tBoardID, string tBoardName, string tBoardPassword, string tBoardType)
		{
            xWinClient = tWinClient;
			localID = tLocalID;
			rootID = tRootID;
			boardID = tBoardID;
			boardName = tBoardName;
		    boardPassword = tBoardPassword;
			boardType = tBoardType;
		}

		public void WinThread()
		{
			xWinClient.AddThread(WC.MakeXML("WinBoard", boardID), this);
			InitializeComponent();
			this.SetConfig();
			this.ShowDialog();
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		private void InitializeComponent()
		{
			this.idStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.uploadLabel = new System.Windows.Forms.Label();
			this.searchButton = new System.Windows.Forms.Button();
			this.writeButton = new System.Windows.Forms.Button();
			this.countBox = new System.Windows.Forms.TextBox();
			this.writerLabel = new System.Windows.Forms.Label();
			this.titleBox = new System.Windows.Forms.TextBox();
			this.listPanel = new System.Windows.Forms.Panel();
			this.searchGroup = new System.Windows.Forms.GroupBox();
			this.allButton = new System.Windows.Forms.Button();
			this.searchBox = new System.Windows.Forms.TextBox();
			this.typeCombo = new System.Windows.Forms.ComboBox();
			this.actionGroup = new System.Windows.Forms.GroupBox();
			this.countLabel = new System.Windows.Forms.Label();
			this.adminButton = new System.Windows.Forms.Button();
			this.mainGrid = new System.Windows.Forms.DataGrid();
			this.tableStyle = new System.Windows.Forms.DataGridTableStyle();
			this.stepStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.titleStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.writerStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.emailStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.uploadStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.hitStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.dateStyle = new System.Windows.Forms.DataGridTextBoxColumn();
			this.inputPanel = new System.Windows.Forms.Panel();
			this.bottomGroup = new System.Windows.Forms.GroupBox();
			this.uploadButton = new System.Windows.Forms.Button();
			this.uploadBox = new System.Windows.Forms.TextBox();
			this.msgLabel = new System.Windows.Forms.Label();
			this.pwdLabel = new System.Windows.Forms.Label();
			this.emailLabel = new System.Windows.Forms.Label();
			this.titleLabel = new System.Windows.Forms.Label();
			this.writerBox = new System.Windows.Forms.TextBox();
			this.pwdBox = new System.Windows.Forms.TextBox();
			this.msgBox = new System.Windows.Forms.RichTextBox();
			this.editMenu = new System.Windows.Forms.ContextMenu();
			this.emailBox = new System.Windows.Forms.TextBox();
			this.topGroup = new System.Windows.Forms.GroupBox();
			this.deleteButton = new System.Windows.Forms.Button();
			this.modifyButton = new System.Windows.Forms.Button();
			this.replyButton = new System.Windows.Forms.Button();
			this.listButton = new System.Windows.Forms.Button();
			this.saveButton = new System.Windows.Forms.Button();
			this.resetButton = new System.Windows.Forms.Button();
			this.saveDialog = new System.Windows.Forms.SaveFileDialog();
			this.openDialog = new System.Windows.Forms.OpenFileDialog();
			this.listPanel.SuspendLayout();
			this.searchGroup.SuspendLayout();
			this.actionGroup.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.mainGrid)).BeginInit();
			this.inputPanel.SuspendLayout();
			this.bottomGroup.SuspendLayout();
			this.topGroup.SuspendLayout();
			this.SuspendLayout();
			// 
			// idStyle
			// 
			this.idStyle.Format = "";
			this.idStyle.FormatInfo = null;
			this.idStyle.HeaderText = "Record ID";
			this.idStyle.MappingName = "recordID";
			this.idStyle.Width = 0;
			// 
			// uploadLabel
			// 
			this.uploadLabel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
			this.uploadLabel.Location = new System.Drawing.Point(8, 256);
			this.uploadLabel.Name = "uploadLabel";
			this.uploadLabel.Size = new System.Drawing.Size(64, 23);
			this.uploadLabel.TabIndex = 0;
			this.uploadLabel.Text = "Upload";
			this.uploadLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// searchButton
			// 
			this.searchButton.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.searchButton.Location = new System.Drawing.Point(392, 16);
			this.searchButton.Name = "searchButton";
			this.searchButton.Size = new System.Drawing.Size(80, 23);
			this.searchButton.TabIndex = 7;
			this.searchButton.Text = "Search";
			this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
			// 
			// writeButton
			// 
			this.writeButton.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.writeButton.Location = new System.Drawing.Point(392, 16);
			this.writeButton.Name = "writeButton";
			this.writeButton.Size = new System.Drawing.Size(80, 24);
			this.writeButton.TabIndex = 2;
			this.writeButton.Text = "Write";
			this.writeButton.Click += new System.EventHandler(this.writeButton_Click);
			// 
			// countBox
			// 
			this.countBox.Anchor = System.Windows.Forms.AnchorStyles.Left;
			this.countBox.Location = new System.Drawing.Point(96, 16);
			this.countBox.Name = "countBox";
			this.countBox.ReadOnly = true;
			this.countBox.Size = new System.Drawing.Size(80, 21);
			this.countBox.TabIndex = 0;
			this.countBox.Text = "0";
			// 
			// writerLabel
			// 
			this.writerLabel.Location = new System.Drawing.Point(8, 48);
			this.writerLabel.Name = "writerLabel";
			this.writerLabel.Size = new System.Drawing.Size(64, 23);
			this.writerLabel.TabIndex = 0;
			this.writerLabel.Text = "Writer";
			this.writerLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// titleBox
			// 
			this.titleBox.Location = new System.Drawing.Point(80, 16);
			this.titleBox.MaxLength = 100;
			this.titleBox.Name = "titleBox";
			this.titleBox.Size = new System.Drawing.Size(392, 21);
			this.titleBox.TabIndex = 7;
			this.titleBox.Text = "";
			// 
			// listPanel
			// 
			this.listPanel.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right);
			this.listPanel.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.searchGroup,
																					this.actionGroup,
																					this.mainGrid});
			this.listPanel.Location = new System.Drawing.Point(8, 8);
			this.listPanel.Name = "listPanel";
			this.listPanel.Size = new System.Drawing.Size(480, 352);
			this.listPanel.TabIndex = 0;
			// 
			// searchGroup
			// 
			this.searchGroup.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right);
			this.searchGroup.Controls.AddRange(new System.Windows.Forms.Control[] {
																					  this.allButton,
																					  this.searchButton,
																					  this.searchBox,
																					  this.typeCombo});
			this.searchGroup.Location = new System.Drawing.Point(0, 296);
			this.searchGroup.Name = "searchGroup";
			this.searchGroup.Size = new System.Drawing.Size(480, 48);
			this.searchGroup.TabIndex = 0;
			this.searchGroup.TabStop = false;
			this.searchGroup.Text = "Search";
			// 
			// allButton
			// 
			this.allButton.Anchor = System.Windows.Forms.AnchorStyles.Left;
			this.allButton.Location = new System.Drawing.Point(8, 16);
			this.allButton.Name = "allButton";
			this.allButton.Size = new System.Drawing.Size(80, 23);
			this.allButton.TabIndex = 4;
			this.allButton.Text = "Refresh All";
			this.allButton.Click += new System.EventHandler(this.allButton_Click);
			// 
			// searchBox
			// 
			this.searchBox.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.searchBox.Location = new System.Drawing.Point(256, 16);
			this.searchBox.MaxLength = 30;
			this.searchBox.Name = "searchBox";
			this.searchBox.Size = new System.Drawing.Size(128, 21);
			this.searchBox.TabIndex = 6;
			this.searchBox.Text = "";
			// 
			// typeCombo
			// 
			this.typeCombo.Anchor = System.Windows.Forms.AnchorStyles.Right;
			this.typeCombo.DropDownWidth = 121;
			this.typeCombo.Items.AddRange(new object[] {
														   "Tilte",
														   "Writer",
														   "Message"});
			this.typeCombo.Location = new System.Drawing.Point(144, 16);
			this.typeCombo.Name = "typeCombo";
			this.typeCombo.Size = new System.Drawing.Size(104, 20);
			this.typeCombo.TabIndex = 5;
			this.typeCombo.Text = "Select Type";
			// 
			// actionGroup
			// 
			this.actionGroup.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right);
			this.actionGroup.Controls.AddRange(new System.Windows.Forms.Control[] {
																					  this.countLabel,
																					  this.countBox,
																					  this.adminButton,
																					  this.writeButton});
			this.actionGroup.Name = "actionGroup";
			this.actionGroup.Size = new System.Drawing.Size(480, 48);
			this.actionGroup.TabIndex = 0;
			this.actionGroup.TabStop = false;
			this.actionGroup.Text = "Action";
			// 
			// countLabel
			// 
			this.countLabel.Anchor = System.Windows.Forms.AnchorStyles.Left;
			this.countLabel.Location = new System.Drawing.Point(8, 24);
			this.countLabel.Name = "countLabel";
			this.countLabel.Size = new System.Drawing.Size(88, 16);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -