伝説のC++大宿題---ローカルエリアネットワークチャット共有ソフト(Need For Share)(二)
76666 ワード
Clientプロジェクト:
一、ファイルリスト:
--------ヘッダファイル---------
Client.h
face.h
hs.h
loading.h
scht.h
share.h
shuxing.h
自分のヘッダ.h
----------cppファイル----------
Client.cpp
facezhuangyong.cpp
ホームサービスcpp
プログラムを起動するcpp
メッセージ処理関数cpp
クラス関数の実装cpp
二、ソースコード
---------------Client.h-------------------
一、ファイルリスト:
--------ヘッダファイル---------
Client.h
face.h
hs.h
loading.h
scht.h
share.h
shuxing.h
自分のヘッダ.h
----------cppファイル----------
Client.cpp
facezhuangyong.cpp
ホームサービスcpp
プログラムを起動するcpp
メッセージ処理関数cpp
クラス関数の実装cpp
二、ソースコード
---------------Client.h-------------------
#pragma once
#include"share.h"
#include"face.h"
#include"hs.h"
#include"scht.h"
#include"shuxing.h"
extern bool is[30];
extern bool is_scht[50];
extern Int16 jilucount;
extern int* jilucmark;
extern bool is_his;
namespace Need_For_Share {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Runtime::InteropServices;
using namespace System::Threading;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::Text;
/// <summary>
/// Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO:
//
}
protected:
/// <summary>
/// 。
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TabControl^ tabControl1;
protected:
private: System::Windows::Forms::TabPage^ tabPage2;
private: System::Windows::Forms::TabPage^ tabPage3;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::SplitContainer^ splitContainer1;
private: System::Windows::Forms::TabControl^ tabControl2;
private: System::Windows::Forms::TabPage^ tabPage1;
private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel1;
private: System::Windows::Forms::Button^ btnfont;
private: System::Windows::Forms::Panel^ panel2;
private: System::Windows::Forms::RichTextBox^ richTextBox2;
private: System::Windows::Forms::Panel^ panel1;
private: System::Windows::Forms::RichTextBox^ richTextBox1;
private: System::ComponentModel::IContainer^ components;
private: Socket^ SAtClient; // socket
array<Thread^>^ readThread; //
array<Thread^>^ myThread; // , 10
array<downing^>^ yourdown; // , 100
private: System::Windows::Forms::TreeView^ mytree;
private: System::Windows::Forms::StatusStrip^ statusStrip1;
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
private: System::Windows::Forms::ToolStripStatusLabel^ zhuangtai;
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel3;
private: System::Windows::Forms::ListView^ mylist;
private: System::Windows::Forms::ImageList^ imageList1;
private: System::Windows::Forms::ColumnHeader^ columnHeader2;
private: System::Windows::Forms::ListView^ mybiglist;
private: System::Windows::Forms::ListView^ mysmalllist;
private: System::Windows::Forms::ComboBox^ comboBox1;
private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel2;
private: System::Windows::Forms::Button^ btnsearch;
private: System::Windows::Forms::Button^ btnhoutui;
private: System::Windows::Forms::Button^ btnqianjin;
private: System::Windows::Forms::Button^ btnshare;
private: System::Windows::Forms::Button^ btndown;
private: System::Windows::Forms::ImageList^ imageList2;
private: System::Windows::Forms::ImageList^ imageList3;
private:
Int32 xpos;
Int32 ypos; //
Int32 beatcount; //
Int16 jibie; // , 1
String^ history; // , “0”
private: System::Windows::Forms::ContextMenuStrip^ helpmybiglist;
private: System::Windows::Forms::ToolStripMenuItem^ help2;
private: System::Windows::Forms::ToolStripMenuItem^ help3;
private: System::Windows::Forms::ToolStripMenuItem^ help6;
private: System::Windows::Forms::ToolStripMenuItem^ help4;
private: System::Windows::Forms::ToolStripMenuItem^ help7;
private: System::Windows::Forms::Button^ btnflash;
private: System::Windows::Forms::OpenFileDialog^ wenjiantu;
private: System::Windows::Forms::Timer^ jishiqi;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::Button^ btnface;
private: System::Windows::Forms::Button^ btnpicture;
private: System::Windows::Forms::Button^ btnhistory;
private: System::Windows::Forms::Button^ btnclear;
private: System::Windows::Forms::FontDialog^ font;
private: System::Windows::Forms::ToolTip^ tpfont;
private: System::Windows::Forms::ToolTip^ tpface;
private: System::Windows::Forms::ToolTip^ tppicture;
private: System::Windows::Forms::ToolTip^ tphistory;
private: System::Windows::Forms::ToolTip^ tpclear;
private: System::Windows::Forms::OpenFileDialog^ chat;
private: System::Windows::Forms::RichTextBox^ richTextBox3;
private: System::Windows::Forms::RichTextBox^ richTextBox4;
private: System::Windows::Forms::ContextMenuStrip^ helpmylist;
private: System::Windows::Forms::ToolStripMenuItem^ fqlt;
private: System::Windows::Forms::ToolStripMenuItem^ xgbz;
private: System::Windows::Forms::TabPage^ tabPage4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button3;
TreeNodeCollection^ jihe;//
void chushihua(); //
void f1(); // ,
void f2(); //
void f3(); //
void f4(Object^ ); // ,
void g1(array<Byte>^ ,Int32 ); //"aac" ,
void g3(array<Byte>^ ,UInt32 ); //"aaf",
void g4(array<Byte>^ ,Int32 ); //"abg" "ab"
yonghu^ g2(array<Byte>^ ,Int32); //
yonghu^ g5(array<Byte>^ ,Int32); //
yonghu^ g6(array<Byte>^ ,Int32); //
yonghu^ g7(array<Byte>^ ,Int32); //
yonghu^ g9(array<Byte>^ ,Int32); // 2
yonghu^ g10(array<Byte>^ ,Int32); //
void g11(array<Byte>^ ,Int32); //
void g8(array<Byte>^ ,Int32); //
void g81(array<Byte>^ ,Int32 ); //
void g12(array<Byte>^ ,Int32 ); //
void g121(array<Byte>^ a,Int32 b); // ,
void g122(Int16 ,Int16 ,downing^ ); // ,a ,b ,c downing
void g123(array<Byte>^ ,Int32 ); // ,
void g13(array<Byte>^ ,Int32 ); //
void g14(array<Byte>^ ,Int32 ); //
void g15(array<Byte>^ ,Int32 ); //
void g16(array<Byte>^ ,Int32 ); //
void g17(array<Byte>^ ,Int32 ); //
void g18(array<Byte>^ ,Int32 ); //
void g19(array<Byte>^ ,Int32 ); //
Customer^ Pemp; //
array<huancun>^ Date; //
array<Byte>^ help; // , ,
Int16 helpmark;
UInt32 helpjindu; //
FileStream^ ffs; //
face^ fe; //
hs^ his; //
String^ lastyonghu; //
int lastmark; //
array<scht^>^ st; //
int leave; //
public : array<down^>^ Down;
delegate void AddTreeNode2(TreeNodeCollection^ ,yonghu^); //
void addtreenode2(TreeNodeCollection^ ,yonghu^ ); //
delegate void InsertTN(TreeNodeCollection^ ,Int16 ,yonghu^ ); //
void inserttn(TreeNodeCollection^ ,Int16 ,yonghu^ ); //
delegate void show(int ); // ,show
void show_scht(int i);
void isEdit(); //
bool issimi(); //
void filejiaok(String^ ,TreeNodeCollection^ ,String^ ); //
void fileok(String^,bool); // ok , ,true
void btnshareok(); // ,
bool isequals(String^ ,String^ ); // CText
void caozuo(TreeNode^ ,String^ ); // CText
void createwjj(String^ ); //
void createwjj(String^ ,TreeNodeCollection^ ,String^ ); //
void createwjjj(String^ ,TreeNodeCollection^ ,String^ ); //
void fileok(String^ ,TreeNodeCollection^ ,String^ ,bool ); //
void adddown(down^ ); // down
void filedown(Int16 ,yonghu^ ); //
void sfordown(down^ ); //
void sfordowned(down^ ); //
bool chongfudown(String^ ,String^ ); //
void changedown(down^ ); //
void isended(down^ ); //
void msgsend(); //
void Addimage(String^ ); //
void Addtext(Int16 ); // ,
void addbText(int ,String^ ); //
void sendbyte(array<Byte>^ ,int ,int ); //
void renewname(); // history , history
void sendforleave(); //
protected:
private:
/// <summary>
/// 。
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// -
/// 。
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
this->tableLayoutPanel1 = (gcnew System::Windows::Forms::TableLayoutPanel());
this->btnfont = (gcnew System::Windows::Forms::Button());
this->btnclear = (gcnew System::Windows::Forms::Button());
this->btnface = (gcnew System::Windows::Forms::Button());
this->btnpicture = (gcnew System::Windows::Forms::Button());
this->btnhistory = (gcnew System::Windows::Forms::Button());
this->label6 = (gcnew System::Windows::Forms::Label());
this->panel2 = (gcnew System::Windows::Forms::Panel());
this->richTextBox2 = (gcnew System::Windows::Forms::RichTextBox());
this->panel1 = (gcnew System::Windows::Forms::Panel());
this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());
this->richTextBox4 = (gcnew System::Windows::Forms::RichTextBox());
this->richTextBox3 = (gcnew System::Windows::Forms::RichTextBox());
this->button1 = (gcnew System::Windows::Forms::Button());
this->tabPage3 = (gcnew System::Windows::Forms::TabPage());
this->btnflash = (gcnew System::Windows::Forms::Button());
this->tableLayoutPanel2 = (gcnew System::Windows::Forms::TableLayoutPanel());
this->btnhoutui = (gcnew System::Windows::Forms::Button());
this->btnqianjin = (gcnew System::Windows::Forms::Button());
this->btnshare = (gcnew System::Windows::Forms::Button());
this->btndown = (gcnew System::Windows::Forms::Button());
this->btnsearch = (gcnew System::Windows::Forms::Button());
this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
this->mysmalllist = (gcnew System::Windows::Forms::ListView());
this->mybiglist = (gcnew System::Windows::Forms::ListView());
this->helpmybiglist = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
this->help2 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->help3 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->help4 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->help7 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->help6 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->imageList2 = (gcnew System::Windows::Forms::ImageList(this->components));
this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
this->tabControl2 = (gcnew System::Windows::Forms::TabControl());
this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
this->mylist = (gcnew System::Windows::Forms::ListView());
this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
this->helpmylist = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
this->fqlt = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->xgbz = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->zhuangtai = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->toolStripStatusLabel3 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->mytree = (gcnew System::Windows::Forms::TreeView());
this->tabPage4 = (gcnew System::Windows::Forms::TabPage());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->imageList3 = (gcnew System::Windows::Forms::ImageList(this->components));
this->wenjiantu = (gcnew System::Windows::Forms::OpenFileDialog());
this->jishiqi = (gcnew System::Windows::Forms::Timer(this->components));
this->font = (gcnew System::Windows::Forms::FontDialog());
this->tpfont = (gcnew System::Windows::Forms::ToolTip(this->components));
this->tpface = (gcnew System::Windows::Forms::ToolTip(this->components));
this->tppicture = (gcnew System::Windows::Forms::ToolTip(this->components));
this->tphistory = (gcnew System::Windows::Forms::ToolTip(this->components));
this->tpclear = (gcnew System::Windows::Forms::ToolTip(this->components));
this->chat = (gcnew System::Windows::Forms::OpenFileDialog());
this->tabControl1->SuspendLayout();
this->tabPage2->SuspendLayout();
this->tableLayoutPanel1->SuspendLayout();
this->panel2->SuspendLayout();
this->panel1->SuspendLayout();
this->tabPage3->SuspendLayout();
this->tableLayoutPanel2->SuspendLayout();
this->helpmybiglist->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->splitContainer1))->BeginInit();
this->splitContainer1->Panel2->SuspendLayout();
this->splitContainer1->SuspendLayout();
this->tabControl2->SuspendLayout();
this->tabPage1->SuspendLayout();
this->helpmylist->SuspendLayout();
this->statusStrip1->SuspendLayout();
this->tabPage4->SuspendLayout();
this->SuspendLayout();
//
// tabControl1
//
this->tabControl1->Appearance = System::Windows::Forms::TabAppearance::Buttons;
this->tabControl1->Controls->Add(this->tabPage2);
this->tabControl1->Controls->Add(this->tabPage3);
this->tabControl1->Font = (gcnew System::Drawing::Font(L" ", 13));
this->tabControl1->ItemSize = System::Drawing::Size(100, 30);
this->tabControl1->Location = System::Drawing::Point(0, 0);
this->tabControl1->Name = L"tabControl1";
this->tabControl1->SelectedIndex = 0;
this->tabControl1->Size = System::Drawing::Size(429, 490);
this->tabControl1->TabIndex = 0;
//
// tabPage2
//
this->tabPage2->BackColor = System::Drawing::SystemColors::Control;
this->tabPage2->Controls->Add(this->tableLayoutPanel1);
this->tabPage2->Controls->Add(this->label6);
this->tabPage2->Controls->Add(this->panel2);
this->tabPage2->Controls->Add(this->panel1);
this->tabPage2->Controls->Add(this->button1);
this->tabPage2->Font = (gcnew System::Drawing::Font(L" ", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(134)));
this->tabPage2->Location = System::Drawing::Point(4, 34);
this->tabPage2->Name = L"tabPage2";
this->tabPage2->Padding = System::Windows::Forms::Padding(3);
this->tabPage2->Size = System::Drawing::Size(421, 452);
this->tabPage2->TabIndex = 1;
this->tabPage2->Text = L" ";
//
// tableLayoutPanel1
//
this->tableLayoutPanel1->ColumnCount = 7;
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute,
245)));
this->tableLayoutPanel1->Controls->Add(this->btnfont, 0, 0);
this->tableLayoutPanel1->Controls->Add(this->btnclear, 6, 0);
this->tableLayoutPanel1->Controls->Add(this->btnface, 2, 0);
this->tableLayoutPanel1->Controls->Add(this->btnpicture, 3, 0);
this->tableLayoutPanel1->Controls->Add(this->btnhistory, 4, 0);
this->tableLayoutPanel1->Location = System::Drawing::Point(0, 257);
this->tableLayoutPanel1->Name = L"tableLayoutPanel1";
this->tableLayoutPanel1->RowCount = 1;
this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 100)));
this->tableLayoutPanel1->Size = System::Drawing::Size(415, 35);
this->tableLayoutPanel1->TabIndex = 4;
//
// btnfont
//
this->btnfont->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btnfont->Location = System::Drawing::Point(3, 3);
this->btnfont->Name = L"btnfont";
this->btnfont->Size = System::Drawing::Size(33, 29);
this->btnfont->TabIndex = 0;
this->btnfont->UseVisualStyleBackColor = true;
this->btnfont->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
// btnclear
//
this->btnclear->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btnclear->Location = System::Drawing::Point(173, 3);
this->btnclear->Name = L"btnclear";
this->btnclear->Size = System::Drawing::Size(38, 29);
this->btnclear->TabIndex = 4;
this->tpclear->SetToolTip(this->btnclear, L" ");
this->btnclear->UseVisualStyleBackColor = true;
this->btnclear->Click += gcnew System::EventHandler(this, &Form1::btnclear_Click);
//
// btnface
//
this->btnface->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btnface->Location = System::Drawing::Point(42, 3);
this->btnface->Name = L"btnface";
this->btnface->Size = System::Drawing::Size(39, 29);
this->btnface->TabIndex = 1;
this->btnface->UseVisualStyleBackColor = true;
this->btnface->Click += gcnew System::EventHandler(this, &Form1::btnface_Click);
//
// btnpicture
//
this->btnpicture->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btnpicture->Location = System::Drawing::Point(87, 3);
this->btnpicture->Name = L"btnpicture";
this->btnpicture->Size = System::Drawing::Size(38, 29);
this->btnpicture->TabIndex = 2;
this->btnpicture->UseVisualStyleBackColor = true;
this->btnpicture->Click += gcnew System::EventHandler(this, &Form1::btnpicture_Click);
//
// btnhistory
//
this->btnhistory->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btnhistory->Location = System::Drawing::Point(131, 3);
this->btnhistory->Name = L"btnhistory";
this->btnhistory->Size = System::Drawing::Size(36, 29);
this->btnhistory->TabIndex = 3;
this->btnhistory->UseVisualStyleBackColor = true;
this->btnhistory->Click += gcnew System::EventHandler(this, &Form1::btnhistory_Click);
//
// label6
//
this->label6->AutoSize = true;
this->label6->Font = (gcnew System::Drawing::Font(L" ", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(134)));
this->label6->Location = System::Drawing::Point(8, 432);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(12, 17);
this->label6->TabIndex = 2;
this->label6->Text = L" ";
//
// panel2
//
this->panel2->Controls->Add(this->richTextBox2);
this->panel2->Location = System::Drawing::Point(3, 292);
this->panel2->Name = L"panel2";
this->panel2->Size = System::Drawing::Size(415, 127);
this->panel2->TabIndex = 0;
//
// richTextBox2
//
this->richTextBox2->BorderStyle = System::Windows::Forms::BorderStyle::None;
this->richTextBox2->Dock = System::Windows::Forms::DockStyle::Fill;
this->richTextBox2->Font = (gcnew System::Drawing::Font(L" ", 10));
this->richTextBox2->Location = System::Drawing::Point(0, 0);
this->richTextBox2->Name = L"richTextBox2";
this->richTextBox2->Size = System::Drawing::Size(415, 127);
this->richTextBox2->TabIndex = 1;
this->richTextBox2->Text = L"";
this->richTextBox2->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::richTextBox2_KeyDown);
//
// panel1
//
this->panel1->Controls->Add(this->richTextBox1);
this->panel1->Controls->Add(this->richTextBox4);
this->panel1->Controls->Add(this->richTextBox3);
this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
this->panel1->Location = System::Drawing::Point(3, 3);
this->panel1->Name = L"panel1";
this->panel1->Size = System::Drawing::Size(415, 251);
this->panel1->TabIndex = 3;
//
// richTextBox1
//
this->richTextBox1->BackColor = System::Drawing::Color::White;
this->richTextBox1->BorderStyle = System::Windows::Forms::BorderStyle::None;
this->richTextBox1->Dock = System::Windows::Forms::DockStyle::Fill;
this->richTextBox1->Font = (gcnew System::Drawing::Font(L" ", 10));
this->richTextBox1->Location = System::Drawing::Point(0, 0);
this->richTextBox1->Name = L"richTextBox1";
this->richTextBox1->ReadOnly = true;
this->richTextBox1->Size = System::Drawing::Size(415, 251);
this->richTextBox1->TabIndex = 0;
this->richTextBox1->Text = L"";
//
// richTextBox4
//
this->richTextBox4->Location = System::Drawing::Point(39, 3);
this->richTextBox4->Name = L"richTextBox4";
this->richTextBox4->Size = System::Drawing::Size(239, 183);
this->richTextBox4->TabIndex = 2;
this->richTextBox4->Text = L"";
//
// richTextBox3
//
this->richTextBox3->Location = System::Drawing::Point(109, 24);
this->richTextBox3->Name = L"richTextBox3";
this->richTextBox3->Size = System::Drawing::Size(277, 162);
this->richTextBox3->TabIndex = 5;
this->richTextBox3->Text = L"";
//
// button1
//
this->button1->Font = (gcnew System::Drawing::Font(L" ", 9));
this->button1->Location = System::Drawing::Point(316, 425);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(99, 24);
this->button1->TabIndex = 2;
this->button1->Text = L" ";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// tabPage3
//
this->tabPage3->BackColor = System::Drawing::SystemColors::Control;
this->tabPage3->Controls->Add(this->btnflash);
this->tabPage3->Controls->Add(this->tableLayoutPanel2);
this->tabPage3->Controls->Add(this->btnsearch);
this->tabPage3->Controls->Add(this->comboBox1);
this->tabPage3->Controls->Add(this->mysmalllist);
this->tabPage3->Controls->Add(this->mybiglist);
this->tabPage3->Location = System::Drawing::Point(4, 34);
this->tabPage3->Name = L"tabPage3";
this->tabPage3->Padding = System::Windows::Forms::Padding(3);
this->tabPage3->Size = System::Drawing::Size(421, 452);
this->tabPage3->TabIndex = 2;
this->tabPage3->Text = L" ";
//
// btnflash
//
this->btnflash->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Center;
this->btnflash->Location = System::Drawing::Point(389, 39);
this->btnflash->Margin = System::Windows::Forms::Padding(0);
this->btnflash->Name = L"btnflash";
this->btnflash->Size = System::Drawing::Size(26, 36);
this->btnflash->TabIndex = 5;
this->btnflash->UseVisualStyleBackColor = true;
this->btnflash->Click += gcnew System::EventHandler(this, &Form1::btnflash_Click);
//
// tableLayoutPanel2
//
this->tableLayoutPanel2->ColumnCount = 4;
this->tableLayoutPanel2->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel2->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel2->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel2->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle()));
this->tableLayoutPanel2->Controls->Add(this->btnhoutui, 0, 0);
this->tableLayoutPanel2->Controls->Add(this->btnqianjin, 1, 0);
this->tableLayoutPanel2->Controls->Add(this->btnshare, 2, 0);
this->tableLayoutPanel2->Controls->Add(this->btndown, 3, 0);
this->tableLayoutPanel2->Font = (gcnew System::Drawing::Font(L" ", 8));
this->tableLayoutPanel2->Location = System::Drawing::Point(8, 3);
this->tableLayoutPanel2->Name = L"tableLayoutPanel2";
this->tableLayoutPanel2->RowCount = 1;
this->tableLayoutPanel2->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 100)));
this->tableLayoutPanel2->Size = System::Drawing::Size(252, 34);
this->tableLayoutPanel2->TabIndex = 4;
//
// btnhoutui
//
this->btnhoutui->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Zoom;
this->btnhoutui->Enabled = false;
this->btnhoutui->Font = (gcnew System::Drawing::Font(L" ", 8));
this->btnhoutui->Location = System::Drawing::Point(3, 3);
this->btnhoutui->Name = L"btnhoutui";
this->btnhoutui->Size = System::Drawing::Size(45, 28);
this->btnhoutui->TabIndex = 0;
this->btnhoutui->UseVisualStyleBackColor = true;
this->btnhoutui->Click += gcnew System::EventHandler(this, &Form1::btnhoutui_Click);
//
// btnqianjin
//
this->btnqianjin->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Zoom;
this->btnqianjin->Enabled = false;
this->btnqianjin->Font = (gcnew System::Drawing::Font(L" ", 8));
this->btnqianjin->Location = System::Drawing::Point(54, 3);
this->btnqianjin->Name = L"btnqianjin";
this->btnqianjin->Size = System::Drawing::Size(45, 28);
this->btnqianjin->TabIndex = 1;
this->btnqianjin->UseVisualStyleBackColor = true;
this->btnqianjin->Click += gcnew System::EventHandler(this, &Form1::btnqianjin_Click);
//
// btnshare
//
this->btnshare->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btnshare->Enabled = false;
this->btnshare->Location = System::Drawing::Point(105, 3);
this->btnshare->Name = L"btnshare";
this->btnshare->Size = System::Drawing::Size(75, 28);
this->btnshare->TabIndex = 2;
this->btnshare->Text = L" ";
this->btnshare->UseVisualStyleBackColor = true;
this->btnshare->Click += gcnew System::EventHandler(this, &Form1::btnshare_Click);
//
// btndown
//
this->btndown->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->btndown->Enabled = false;
this->btndown->Location = System::Drawing::Point(186, 3);
this->btndown->Name = L"btndown";
this->btndown->Size = System::Drawing::Size(66, 28);
this->btndown->TabIndex = 3;
this->btndown->Text = L" ";
this->btndown->UseVisualStyleBackColor = true;
this->btndown->Click += gcnew System::EventHandler(this, &Form1::btndown_Click);
//
// btnsearch
//
this->btnsearch->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
this->btnsearch->Location = System::Drawing::Point(389, 6);
this->btnsearch->Name = L"btnsearch";
this->btnsearch->Size = System::Drawing::Size(26, 27);
this->btnsearch->TabIndex = 3;
this->btnsearch->UseVisualStyleBackColor = true;
this->btnsearch->Click += gcnew System::EventHandler(this, &Form1::btnsearch_Click);
//
// comboBox1
//
this->comboBox1->Font = (gcnew System::Drawing::Font(L" ", 10));
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Location = System::Drawing::Point(266, 6);
this->comboBox1->Name = L"comboBox1";
this->comboBox1->Size = System::Drawing::Size(117, 27);
this->comboBox1->TabIndex = 2;
this->comboBox1->Text = L" ";
this->comboBox1->Click += gcnew System::EventHandler(this, &Form1::comboBox1_Click);
//
// mysmalllist
//
this->mysmalllist->Activation = System::Windows::Forms::ItemActivation::OneClick;
this->mysmalllist->Alignment = System::Windows::Forms::ListViewAlignment::Left;
this->mysmalllist->Font = (gcnew System::Drawing::Font(L" ", 10));
this->mysmalllist->HotTracking = true;
this->mysmalllist->HoverSelection = true;
this->mysmalllist->Location = System::Drawing::Point(3, 39);
this->mysmalllist->MultiSelect = false;
this->mysmalllist->Name = L"mysmalllist";
this->mysmalllist->Scrollable = false;
this->mysmalllist->Size = System::Drawing::Size(380, 36);
this->mysmalllist->TabIndex = 1;
this->mysmalllist->TileSize = System::Drawing::Size(90, 36);
this->mysmalllist->UseCompatibleStateImageBehavior = false;
this->mysmalllist->View = System::Windows::Forms::View::Tile;
this->mysmalllist->Click += gcnew System::EventHandler(this, &Form1::mysmalllist_Click);
//
// mybiglist
//
this->mybiglist->AllowDrop = true;
this->mybiglist->ContextMenuStrip = this->helpmybiglist;
this->mybiglist->Dock = System::Windows::Forms::DockStyle::Bottom;
this->mybiglist->LargeImageList = this->imageList2;
this->mybiglist->Location = System::Drawing::Point(3, 81);
this->mybiglist->Name = L"mybiglist";
this->mybiglist->Size = System::Drawing::Size(415, 368);
this->mybiglist->SmallImageList = this->imageList1;
this->mybiglist->TabIndex = 0;
this->mybiglist->UseCompatibleStateImageBehavior = false;
this->mybiglist->AfterLabelEdit += gcnew System::Windows::Forms::LabelEditEventHandler(this, &Form1::mybiglist_AfterLabelEdit);
this->mybiglist->Click += gcnew System::EventHandler(this, &Form1::mybiglist_Click);
this->mybiglist->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::mybiglist_DragDrop);
this->mybiglist->DragEnter += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::mybiglist_DragEnter);
this->mybiglist->DoubleClick += gcnew System::EventHandler(this, &Form1::mybiglist_DoubleClick);
this->mybiglist->MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::mybiglist_MouseMove);
this->mybiglist->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::mybiglist_MouseUp);
//
// helpmybiglist
//
this->helpmybiglist->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(5) {this->help2, this->help3,
this->help4, this->help7, this->help6});
this->helpmybiglist->Name = L"contextMenuStrip1";
this->helpmybiglist->Size = System::Drawing::Size(149, 114);
this->helpmybiglist->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &Form1::helpmybiglist_Opening);
//
// help2
//
this->help2->Name = L"help2";
this->help2->Size = System::Drawing::Size(148, 22);
this->help2->Text = L" ";
//
// help3
//
this->help3->Name = L"help3";
this->help3->Size = System::Drawing::Size(148, 22);
this->help3->Text = L" ";
//
// help4
//
this->help4->Name = L"help4";
this->help4->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::W));
this->help4->ShowShortcutKeys = false;
this->help4->Size = System::Drawing::Size(148, 22);
this->help4->Text = L" (&W)";
this->help4->Click += gcnew System::EventHandler(this, &Form1::help4_Click);
//
// help7
//
this->help7->Name = L"help7";
this->help7->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::M));
this->help7->ShowShortcutKeys = false;
this->help7->Size = System::Drawing::Size(148, 22);
this->help7->Text = L" (&M)";
this->help7->Click += gcnew System::EventHandler(this, &Form1::help7_Click);
//
// help6
//
this->help6->Name = L"help6";
this->help6->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::R));
this->help6->ShowShortcutKeys = false;
this->help6->Size = System::Drawing::Size(148, 22);
this->help6->Text = L" (&R)";
this->help6->Click += gcnew System::EventHandler(this, &Form1::help6_Click);
//
// imageList2
//
this->imageList2->ColorDepth = System::Windows::Forms::ColorDepth::Depth32Bit;
this->imageList2->ImageSize = System::Drawing::Size(80, 80);
this->imageList2->TransparentColor = System::Drawing::Color::Transparent;
//
// imageList1
//
this->imageList1->ColorDepth = System::Windows::Forms::ColorDepth::Depth32Bit;
this->imageList1->ImageSize = System::Drawing::Size(50, 50);
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
//
// splitContainer1
//
this->splitContainer1->IsSplitterFixed = true;
this->splitContainer1->Location = System::Drawing::Point(0, 0);
this->splitContainer1->Name = L"splitContainer1";
//
// splitContainer1.Panel2
//
this->splitContainer1->Panel2->Controls->Add(this->tabControl2);
this->splitContainer1->Size = System::Drawing::Size(709, 490);
this->splitContainer1->SplitterDistance = 425;
this->splitContainer1->TabIndex = 1;
//
// tabControl2
//
this->tabControl2->Appearance = System::Windows::Forms::TabAppearance::Buttons;
this->tabControl2->Controls->Add(this->tabPage1);
this->tabControl2->Controls->Add(this->tabPage4);
this->tabControl2->Font = (gcnew System::Drawing::Font(L" ", 13));
this->tabControl2->ItemSize = System::Drawing::Size(60, 30);
this->tabControl2->Location = System::Drawing::Point(0, 0);
this->tabControl2->Name = L"tabControl2";
this->tabControl2->SelectedIndex = 0;
this->tabControl2->Size = System::Drawing::Size(280, 490);
this->tabControl2->TabIndex = 0;
//
// tabPage1
//
this->tabPage1->BackColor = System::Drawing::SystemColors::Control;
this->tabPage1->Controls->Add(this->mylist);
this->tabPage1->Controls->Add(this->statusStrip1);
this->tabPage1->Controls->Add(this->mytree);
this->tabPage1->Location = System::Drawing::Point(4, 34);
this->tabPage1->Name = L"tabPage1";
this->tabPage1->Padding = System::Windows::Forms::Padding(3);
this->tabPage1->Size = System::Drawing::Size(272, 452);
this->tabPage1->TabIndex = 0;
this->tabPage1->Text = L" ";
//
// mylist
//
this->mylist->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(1) {this->columnHeader2});
this->mylist->ContextMenuStrip = this->helpmylist;
this->mylist->Dock = System::Windows::Forms::DockStyle::Fill;
this->mylist->Font = (gcnew System::Drawing::Font(L" ", 10));
this->mylist->LabelEdit = true;
this->mylist->Location = System::Drawing::Point(3, 3);
this->mylist->MultiSelect = false;
this->mylist->Name = L"mylist";
this->mylist->Size = System::Drawing::Size(266, 424);
this->mylist->SmallImageList = this->imageList1;
this->mylist->TabIndex = 2;
this->mylist->UseCompatibleStateImageBehavior = false;
this->mylist->View = System::Windows::Forms::View::Details;
this->mylist->AfterLabelEdit += gcnew System::Windows::Forms::LabelEditEventHandler(this, &Form1::mylist_AfterLabelEdit);
this->mylist->DoubleClick += gcnew System::EventHandler(this, &Form1::mylist_DoubleClick);
//
// columnHeader2
//
this->columnHeader2->Text = L" ";
this->columnHeader2->Width = 143;
//
// helpmylist
//
this->helpmylist->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->fqlt, this->xgbz});
this->helpmylist->Name = L"contextMenuStrip1";
this->helpmylist->Size = System::Drawing::Size(125, 48);
this->helpmylist->Opened += gcnew System::EventHandler(this, &Form1::helpmylist_Opened);
//
// fqlt
//
this->fqlt->Name = L"fqlt";
this->fqlt->Size = System::Drawing::Size(124, 22);
this->fqlt->Text = L" ";
this->fqlt->Click += gcnew System::EventHandler(this, &Form1::fqlt_Click);
//
// xgbz
//
this->xgbz->Name = L"xgbz";
this->xgbz->Size = System::Drawing::Size(124, 22);
this->xgbz->Text = L" ";
this->xgbz->Click += gcnew System::EventHandler(this, &Form1::xgbz_Click);
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->toolStripStatusLabel1,
this->zhuangtai, this->toolStripStatusLabel3});
this->statusStrip1->Location = System::Drawing::Point(3, 427);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(266, 22);
this->statusStrip1->TabIndex = 3;
this->statusStrip1->Text = L"statusStrip1";
//
// toolStripStatusLabel1
//
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
this->toolStripStatusLabel1->Size = System::Drawing::Size(48, 17);
this->toolStripStatusLabel1->Text = L" ";
//
// zhuangtai
//
this->zhuangtai->Name = L"zhuangtai";
this->zhuangtai->Size = System::Drawing::Size(0, 17);
//
// toolStripStatusLabel3
//
this->toolStripStatusLabel3->Name = L"toolStripStatusLabel3";
this->toolStripStatusLabel3->Size = System::Drawing::Size(48, 17);
this->toolStripStatusLabel3->Text = L" ";
//
// mytree
//
this->mytree->Location = System::Drawing::Point(42, 57);
this->mytree->Name = L"mytree";
this->mytree->Size = System::Drawing::Size(180, 241);
this->mytree->TabIndex = 0;
//
// tabPage4
//
this->tabPage4->AutoScroll = true;
this->tabPage4->BackColor = System::Drawing::Color::White;
this->tabPage4->Controls->Add(this->button5);
this->tabPage4->Controls->Add(this->button4);
this->tabPage4->Controls->Add(this->button3);
this->tabPage4->Location = System::Drawing::Point(4, 34);
this->tabPage4->Name = L"tabPage4";
this->tabPage4->Padding = System::Windows::Forms::Padding(3);
this->tabPage4->Size = System::Drawing::Size(272, 452);
this->tabPage4->TabIndex = 1;
this->tabPage4->Text = L" ";
//
// button5
//
this->button5->Font = (gcnew System::Drawing::Font(L" ", 9));
this->button5->Location = System::Drawing::Point(167, 3);
this->button5->Name = L"button5";
this->button5->Size = System::Drawing::Size(88, 23);
this->button5->TabIndex = 3;
this->button5->Text = L" ";
this->button5->UseVisualStyleBackColor = true;
this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
//
// button4
//
this->button4->Font = (gcnew System::Drawing::Font(L" ", 9));
this->button4->Location = System::Drawing::Point(86, 3);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(75, 23);
this->button4->TabIndex = 2;
this->button4->Text = L" ";
this->button4->UseVisualStyleBackColor = true;
//
// button3
//
this->button3->Font = (gcnew System::Drawing::Font(L" ", 9));
this->button3->Location = System::Drawing::Point(5, 3);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(75, 23);
this->button3->TabIndex = 1;
this->button3->Text = L" ";
this->button3->UseVisualStyleBackColor = true;
//
// imageList3
//
this->imageList3->ColorDepth = System::Windows::Forms::ColorDepth::Depth32Bit;
this->imageList3->ImageSize = System::Drawing::Size(80, 80);
this->imageList3->TransparentColor = System::Drawing::Color::Transparent;
//
// wenjiantu
//
this->wenjiantu->FileName = L"openFileDialog1";
this->wenjiantu->FileOk += gcnew System::ComponentModel::CancelEventHandler(this, &Form1::wenjiantu_FileOk);
//
// jishiqi
//
this->jishiqi->Interval = 1000;
this->jishiqi->Tick += gcnew System::EventHandler(this, &Form1::jishiqi_Tick);
//
// font
//
this->font->Font = (gcnew System::Drawing::Font(L" ", 10));
//
// chat
//
this->chat->FileName = L"openFileDialog1";
this->chat->FileOk += gcnew System::ComponentModel::CancelEventHandler(this, &Form1::chat_FileOk);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(709, 491);
this->Controls->Add(this->tabControl1);
this->Controls->Add(this->splitContainer1);
this->MaximumSize = System::Drawing::Size(725, 530);
this->MinimumSize = System::Drawing::Size(725, 530);
this->Name = L"Form1";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"Need For Share";
this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->tabControl1->ResumeLayout(false);
this->tabPage2->ResumeLayout(false);
this->tabPage2->PerformLayout();
this->tableLayoutPanel1->ResumeLayout(false);
this->panel2->ResumeLayout(false);
this->panel1->ResumeLayout(false);
this->tabPage3->ResumeLayout(false);
this->tableLayoutPanel2->ResumeLayout(false);
this->helpmybiglist->ResumeLayout(false);
this->splitContainer1->Panel2->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->splitContainer1))->EndInit();
this->splitContainer1->ResumeLayout(false);
this->tabControl2->ResumeLayout(false);
this->tabPage1->ResumeLayout(false);
this->tabPage1->PerformLayout();
this->helpmylist->ResumeLayout(false);
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
this->tabPage4->ResumeLayout(false);
this->ResumeLayout(false);
}
#pragma endregion
//
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
qidong();
if(!is[4])
this->Close();
else
{
chushihua();
String^ a=gcnew String(UserName());
String^ b=gcnew String(UserPictureLocation());
bool c=isBoy();
Pemp=gcnew Customer(a,b,c); //
Date=gcnew array<huancun>(5); //
beatcount=0;
for(int i=0;i<5;i++)
{
Date[i].date=gcnew array<Byte>(5242880);
Date[i].hCount=0;
Date[i].is=false;
} // 5m*5
readThread=gcnew array<Thread^>(3);
readThread[0]=gcnew Thread(gcnew ThreadStart(this,&Form1::f1));
readThread[0]->IsBackground=true;
readThread[0]->Start();
}
}
//
private: System::Void comboBox1_Click(System::Object^ sender, System::EventArgs^ e) {
comboBox1->Text="";
}
// , ,
private: System::Void mybiglist_Click(System::Object^ sender, System::EventArgs^ e) {
btndown->Enabled=true;
}
// mybiglist
private: System::Void mybiglist_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
xpos=e->X;
ypos=e->Y;
}
//
private: System::Void mybiglist_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
if(mybiglist->HitTest(xpos,ypos)->Item==nullptr||issimi()||jibie==1||history->Substring(2,2)->Equals((Pemp->CMark-100).ToString()->PadRight(2)))
{
btndown->Enabled=false;
}
if(mybiglist->HitTest(xpos,ypos)->Item!=nullptr)
help7->Enabled=help4->Enabled;
else
help7->Enabled=false;
}
//
private: System::Void mybiglist_DoubleClick(System::Object^ sender, System::EventArgs^ e) {
btndown->Enabled=false;
Int16 a=mybiglist->SelectedIndices[0];
bool sorl=false; // s、 l
switch(mybiglist->View)
{
case System::Windows::Forms::View::SmallIcon:
case System::Windows::Forms::View::LargeIcon:
mybiglist->LargeImageList=imageList3;
//
if(safe_cast<yonghu^>(jihe[a])->choice==3||safe_cast<yonghu^>(jihe[a])->choice==4) // ,
return;
// history
history=history->Substring(0,jibie*2)+a.ToString()->PadRight(2);
//
if(jibie<4)
{
mysmalllist->Items->Add(jihe[a]->Text+"->");
}
else
{
mysmalllist->Items[0]->Text="……<<";
mysmalllist->Items[1]->Text=mysmalllist->Items[2]->Text;;
mysmalllist->Items[2]->Text=mysmalllist->Items[3]->Text;
mysmalllist->Items[3]->Text=jihe[a]->Text+"->";
}
// mybiglist
if(jihe[a]->FirstNode!=nullptr)
{
jihe=jihe[a]->Nodes;
a=0;
mybiglist->Items->Clear();
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
break;
}
while(jihe[a]->NextNode!=nullptr)
{
a++;
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
break;
}
}
}
else
{
mybiglist->Items->Clear();
jihe=jihe[a]->Nodes;
}
btnhoutui->Enabled=true;
btnqianjin->Enabled=false;
jibie++;
break;
default:
break;
}
isEdit();
}
//
private: System::Void btnhoutui_Click(System::Object^ sender, System::EventArgs^ e) {
btndown->Enabled=false;
Int16 a;
TreeNodeCollection^ temp;
switch(mybiglist->View)
{
case System::Windows::Forms::View::SmallIcon:
case System::Windows::Forms::View::LargeIcon:
//
if(jihe->Count==0)
{
jihe->Add(gcnew yonghu(4));
temp=jihe;
is[7]=true;
}
if(jihe[0]->Parent->Parent==nullptr)
jihe=mytree->Nodes;
else
jihe=jihe[0]->Parent->Parent->Nodes;
if(is[7])
{
temp->RemoveAt(0);
is[7]=false;
}
//
if(mysmalllist->Items[0]->Text->Equals("……<<"))
{
mysmalllist->Items[3]->Text=mysmalllist->Items[2]->Text;
mysmalllist->Items[2]->Text=mysmalllist->Items[1]->Text;
if(jibie==5)
mysmalllist->Items[0]->Text=" ->";
temp=mytree->Nodes;
for(int i=0;i<jibie-5;i++)
{
a=Int16::Parse(history->Substring(2*i+2,2)->Trim());
temp=temp[a]->Nodes;
}
a=Int16::Parse(history->Substring(2*jibie-8,2)->Trim());
mysmalllist->Items[1]->Text=temp[a]->Text;
}
else
mysmalllist->Items->RemoveAt(jibie-1);
// mybiglist
mybiglist->Items->Clear();
a=0;
if(jibie==2)
{
mybiglist->LargeImageList=imageList2;
mybiglist->SmallImageList=imageList1;
btnhoutui->Enabled=false; // false
}
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
while(jihe[a]->NextNode!=nullptr)
{
a++;
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
}
btnqianjin->Enabled=true;
jibie--;
break;
default:
break;
}
isEdit();
}
//
private: System::Void btnqianjin_Click(System::Object^ sender, System::EventArgs^ e) {
btndown->Enabled=false;
Int16 a=Int16::Parse(history->Substring(2*jibie,2)->Trim());
bool sorl=false;
switch(mybiglist->View)
{
case System::Windows::Forms::View::SmallIcon:
case System::Windows::Forms::View::LargeIcon:
mybiglist->LargeImageList=imageList3;
//
if(jibie<4)
{
mysmalllist->Items->Add(jihe[a]->Text+"->");
}
else
{
mysmalllist->Items[0]->Text="……<<";
mysmalllist->Items[1]->Text=mysmalllist->Items[2]->Text;
mysmalllist->Items[2]->Text=mysmalllist->Items[3]->Text;
mysmalllist->Items[3]->Text=jihe[a]->Text+"->";
}
if(jihe[a]->FirstNode!=nullptr)
{
jihe=jihe[a]->Nodes;
a=0;
mybiglist->Items->Clear();
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
break;
}
while(jihe[a]->NextNode!=nullptr)
{
a++;
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
}
}
else
{
mybiglist->Items->Clear();
jihe=jihe[a]->Nodes;
}
jibie++;
if(history->Length==2*jibie)
btnqianjin->Enabled=false;
btnhoutui->Enabled=true;
break;
default:
break;
}
isEdit();
}
//
private: System::Void mysmalllist_Click(System::Object^ sender, System::EventArgs^ e) {
btndown->Enabled=false;
Int16 a;
TreeNodeCollection^ temp;;
Int16 xunhuanshu;
//
xunhuanshu=mysmalllist->Items->Count-mysmalllist->SelectedIndices[0]-1;
if(xunhuanshu==0)
return;
//
temp=mytree->Nodes;
if(jibie-xunhuanshu>=4)
{
for(int i=0;i<jibie-xunhuanshu-4;i++)
{
a=Int16::Parse(history->Substring(2*i+2,2)->Trim());
temp=temp[a]->Nodes;
}
a=Int16::Parse(history->Substring(2*jibie-2*xunhuanshu-6,2)->Trim());
mysmalllist->Items[1]->Text=temp[a]->Text+"->";
temp=temp[a]->Nodes;
a=Int16::Parse(history->Substring(2*jibie-2*xunhuanshu-4,2)->Trim());
mysmalllist->Items[2]->Text=temp[a]->Text+"->";
temp=temp[a]->Nodes;
a=Int16::Parse(history->Substring(2*jibie-2*xunhuanshu-2,2));
mysmalllist->Items[3]->Text=temp[a]->Text+"->";
temp=temp[a]->Nodes;
if(jibie-xunhuanshu==4)
mysmalllist->Items[0]->Text=" ->";
}
else
{
temp=mytree->Nodes;
while(mysmalllist->Items->Count-jibie+xunhuanshu!=0)
mysmalllist->Items->RemoveAt(mysmalllist->Items->Count-1);
mysmalllist->Items[0]->Text=" ->";
for(int i=0;i<jibie-xunhuanshu-1;i++)
{
a=Int16::Parse(history->Substring(2*i+2,2)->Trim());
mysmalllist->Items[i+1]->Text=temp[a]->Text+"->";
temp=temp[a]->Nodes;
}
}
//
if(jihe->Count==0)
{
jihe->Add(gcnew yonghu(4));
temp=jihe;
is[7]=true;
}
for(int i=0;i<xunhuanshu;i++)
{
if(jihe[0]->Parent->Parent==nullptr)
jihe=mytree->Nodes;
else
jihe=jihe[0]->Parent->Parent->Nodes;
}
if(is[7])
{
temp->RemoveAt(0);
is[7]=false;
}
// mybiglist
mybiglist->Items->Clear();
if(jibie-xunhuanshu==1)
{
mybiglist->LargeImageList=imageList2;
mybiglist->SmallImageList=imageList1;
btnhoutui->Enabled=false;
}
a=0;
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
while(jihe[a]->NextNode!=nullptr)
{
a++;
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
}
btnqianjin->Enabled=true;
jibie-=xunhuanshu;
isEdit();
}
//
private: System::Void helpmybiglist_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
help3->Enabled=btndown->Enabled;
if(jibie==1)
{
help6->Enabled=true;
help4->Enabled=false;
}
else
{
help6->Enabled=false;
help4->Enabled=history->Substring(2,2)->Trim()->Equals((Pemp->CMark-100).ToString());
}
if(help4->Enabled);
else
{
help7->Enabled=false;
}
}
//
private: System::Void help4_Click(System::Object^ sender, System::EventArgs^ e) {
createwjj(" ");
mybiglist->Items->Add(" ");
if(jibie<3||!history->Substring(4,2)->Trim()->Equals("0"))
mybiglist->Items[mybiglist->Items->Count-1]->ImageIndex=1;
else
mybiglist->Items[mybiglist->Items->Count-1]->ImageIndex=0;
mybiglist->Items[mybiglist->Items->Count-1]->BeginEdit();
}
//
private: System::Void help7_Click(System::Object^ sender, System::EventArgs^ e) {
Int16 a=mybiglist->SelectedIndices[0];
if(safe_cast<yonghu^>(jihe[a])->choice==2)
{
MessageBox::Show(" !");
return;
}
mybiglist->Items[a]->BeginEdit();
}
//
private: System::Void mybiglist_AfterLabelEdit(System::Object^ sender, System::Windows::Forms::LabelEditEventArgs^ e) {
if(e->Label==nullptr||e->Label=="")
{
e->CancelEdit=true;
return;
}
jihe[e->Item]->Text=e->Label;
mybiglist->Items[e->Item]->Text=e->Label; // ,
array<Byte>^ temp=safe_cast<yonghu^>(jihe[e->Item])->ConvertByte(safe_cast<yonghu^>(jihe[e->Item])->choice);
array<Byte>^ tosas=gcnew array<Byte>(temp->Length+107);
Encoding::UTF8->GetBytes((temp->Length+107).ToString()->PadRight(7),0,7,tosas,0);
tosas[7]='b';
tosas[8]='b';
tosas[9]='b';
String^ path=history->Substring(0,2*jibie)+e->Item.ToString()->PadRight(2);
Encoding::UTF8->GetBytes(path->PadRight(97),0,97,tosas,10);
Array::Copy(temp,0,tosas,107,temp->Length);
try
{
SAtClient->Send(tosas);
}
catch(Exception^ )
{
MessageBox::Show(" , !");
}
}
//
private: System::Void btnflash_Click(System::Object^ sender, System::EventArgs^ e) {
if(mybiglist->Items->Count==0)
return;
Int16 a=0;
mybiglist->Items->Clear();
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
while(jihe[a]->NextNode!=nullptr)
{
a++;
mybiglist->Items->Add(jihe[a]->Text);
switch(safe_cast<yonghu^>(jihe[a])->choice)
{
case 2:
case 5:
mybiglist->Items[a]->ImageIndex=0; //
break;
case 3:
case 4:
mybiglist->Items[a]->ImageIndex=2;
break;
case 6:
mybiglist->Items[a]->ImageIndex=1;
break;
default:
mybiglist->Items[a]->ImageIndex=a;
break;
}
}
}
//
private: System::Void btnshare_Click(System::Object^ sender, System::EventArgs^ e) {
btnshareok();
}
// ok
private: System::Void wenjiantu_FileOk(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
String^ path=wenjiantu->FileName;
path=path->Replace("\\","\\\\");
fileok(path,issimi());
}
//
private: System::Void btndown_Click(System::Object^ sender, System::EventArgs^ e) {
beforedown(); // ,
Int16 f;
for(int i=0;i<mybiglist->SelectedItems->Count;i++)
{
f=mybiglist->SelectedIndices[i];
if(safe_cast<yonghu^>(jihe[f])->choice==3||safe_cast<yonghu^>(jihe[f])->choice==4) // ,
{
filedown(down::count,safe_cast<yonghu^>(jihe[f])); //
}
else
{
}
}
}
//
private: System::Void mybiglist_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
if(!btnshare->Enabled)
return;
is[8]=true;
Int16 len=safe_cast<System::Array^>(e->Data->GetData(DataFormats::FileDrop))->Length;
array<drog>^ dr=gcnew array<drog>(len);
for(int i=0;i<len;i++)
{
dr[i].fileName=safe_cast<System::Array^>(e->Data->GetData(DataFormats::FileDrop))->GetValue(i)->ToString();
dr[i].fileName=dr[i].fileName->Replace("\\","\\\\");
dr[i].is=panduan(dr[i]);
} //
for(int i=0;i<len;i++)
{
// ,
if((dr[i].is&&!nulldirectory(dr[i].fileName)&&issimi())||(!dr[i].is&&issimi()))
{
share^ f=gcnew share();
TreeNode^ temp=mytree->Nodes[0];
if(safe_cast<yonghu^>(temp)->CMark!=Pemp->CMark)
{
f->sharetree->Nodes->Add(gcnew sharetn(temp->Text,safe_cast<yonghu^>(temp)->CMark));
f->imageList1->Images->Add(Image::FromFile(safe_cast<yonghu^>(temp)->CPicture));
}
while(temp->NextNode!=nullptr)
{
temp=temp->NextNode;
if(safe_cast<yonghu^>(temp)->CMark==Pemp->CMark)
continue;
f->sharetree->Nodes->Add(gcnew sharetn(temp->Text,safe_cast<yonghu^>(temp)->CMark));
f->imageList1->Images->Add(Image::FromFile(safe_cast<yonghu^>(temp)->CPicture));
}
f->ShowDialog();
if(!is[9])
return;
break;
}
} //
for(int i=0;i<len;i++)
{
if(dr[i].is)
{
mybiglist->Items->Add(gcnew String(getname(dr[i].fileName)));
if(jibie<3||!history->Substring(4,2)->Trim()->Equals("0"))
mybiglist->Items[mybiglist->Items->Count-1]->ImageIndex=1;
else
mybiglist->Items[mybiglist->Items->Count-1]->ImageIndex=0;
filejiaok(dr[i].fileName,jihe,history->Substring(0,2*jibie)); //
}
else
{
mybiglist->Items->Add(gcnew String(getname(dr[i].fileName)));
mybiglist->Items[mybiglist->Items->Count-1]->ImageIndex=2;
fileok(dr[i].fileName,jihe,history->Substring(0,2*jibie),issimi()); //
}
}
}
//
private: System::Void mybiglist_DragEnter(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
if(!btnshare->Enabled)
return;
e->Effect = DragDropEffects::All;
}
// , , ,
private: System::Void jishiqi_Tick(System::Object^ sender, System::EventArgs^ e) {
Int16 sc;
if(down::count>3)
sc=3;
else
sc=down::count;
for(int i=0;i<sc;i++) //
{
changedown(Down[i]);
if(down::count>3)
sc=3;
else
sc=down::count;
}
}
// ,Shift+Enter ,Enter
private: System::Void richTextBox2_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) {
if(e->KeyCode==Keys::Enter&&e->Shift)
{
richTextBox2->AppendText("
");
return;
}
if(e->KeyCode==Keys::Enter)
{
e->SuppressKeyPress=true;
msgsend(); //
richTextBox2->Focus();
}
}
//
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
font->ShowColor=true;
Windows::Forms::DialogResult result;
result=font->ShowDialog();
if(result==Windows::Forms::DialogResult::OK)
{
richTextBox2->Font=font->Font;
richTextBox2->ForeColor=font->Color;
}
richTextBox2->Focus();
}
//
private: System::Void btnface_Click(System::Object^ sender, System::EventArgs^ e) {
fe->ShowDialog();
if(!fe->index)
{
richTextBox2->Focus();
return;
}
int ix=fe->index;
int sm=fe->shumu;
String^ path=gcnew String(AppName());
path+="face\\";
if(ix==1)
path+="facea\\";
else
path+="faceb\\";
path+=sm.ToString()+".png";
is[11]=true;
Addimage(path);
richTextBox2->Focus();
}
//
private: System::Void btnpicture_Click(System::Object^ sender, System::EventArgs^ e) {
chat->ShowDialog();
richTextBox2->Focus();
}
//
private: System::Void chat_FileOk(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
Addimage(chat->FileName);
richTextBox2->Focus();
}
//
private: System::Void Form1_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
if(!is[4]||Pemp->CMark==0||is[12])
return;
sendforleave(); //
richTextBox1->SaveFile(gcnew String(AppName())+"User\\history.rtf");
renewname(); //
}
//
private: System::Void btnclear_Click(System::Object^ sender, System::EventArgs^ e) {
richTextBox1->SaveFile(gcnew String(AppName())+"User\\history.rtf");
renewname();
richTextBox1->Clear();
lastyonghu="";
lastmark=-1;
}
//
private: System::Void btnhistory_Click(System::Object^ sender, System::EventArgs^ e) {
richTextBox1->SaveFile(gcnew String(AppName())+"User\\history.rtf");
if(!is_his)
{
his=gcnew hs();
is_his=true;
}
his->Show();
his->Focus();
}
//
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
msgsend(); //
richTextBox2->Focus();
scht^ si=gcnew scht();
si->Show();
}
// ,
private: System::Void mylist_DoubleClick(System::Object^ sender, System::EventArgs^ e) {
int k=mylist->SelectedIndices[0];
if(!is_scht[k])
{
st[k]=gcnew scht();
st[k]->label1->Text=" "+mylist->Items[k]->Text->Trim()+" …";
st[k]->CMark=k+100+(k+100)/Pemp->CMark;
st[k]->touxiang->ImageLocation=safe_cast<yonghu^ >(mytree->Nodes[st[k]->CMark-100])->CPicture;
st[k]->name=mylist->Items[k]->Text->Trim();
st[k]->pcmark=Pemp->CMark;
st[k]->bname=mytree->Nodes[Pemp->CMark-100]->Text->Trim();
st[k]->SAtClient=SAtClient;
is_scht[k]=true;
}
st[k]->Show();
st[k]->Focus();
}
//
private: System::Void linkLabel2_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) {
MessageBox::Show(" , !");
LinkLabel^ pic=(LinkLabel^)sender;
int j=0;
for(;j<down::count;j++)
{
if(Down[j]->cancel==pic)
break;
}
tabPage4->Controls->Remove(Down[j]->name);
tabPage4->Controls->Remove(Down[j]->size);
tabPage4->Controls->Remove(Down[j]->time);
tabPage4->Controls->Remove(Down[j]->speed);
tabPage4->Controls->Remove(Down[j]->pause);
tabPage4->Controls->Remove(Down[j]->cancel);
tabPage4->Controls->Remove(Down[j]->progress);
if(down::count==1)
{
down::count--;
return;
}
for(int i=j+1;i<down::count;i++)
{
Down[i]->name->Location = System::Drawing::Point(6, Down[i]->name->Location.Y-96);
Down[i]->size->Location = System::Drawing::Point(6, Down[i]->size->Location.Y-96);
Down[i]->time->Location = System::Drawing::Point(7, Down[i]->time->Location.Y-96);
Down[i]->speed->Location = System::Drawing::Point(69, Down[i]->speed->Location.Y-96);
Down[i]->pause->Location = System::Drawing::Point(175, Down[i]->pause->Location.Y-96);
Down[i]->cancel->Location = System::Drawing::Point(213, Down[i]->cancel->Location.Y-96);
Down[i]->progress->Location = System::Drawing::Point(10, Down[i]->progress->Location.Y-96);
Down[i]->pause->Location = System::Drawing::Point(175, Down[i]->pause->Location.Y-96);
}
for(int i=j;i<down::count-1;i++)
{
Down[i]=Down[i+1];
}
down::count--;
}
//
private: System::Void linkLabel3_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) {
MessageBox::Show(" , 。。。。 ……");
}
//
private: System::Void fqlt_Click(System::Object^ sender, System::EventArgs^ e) {
int k=mylist->SelectedIndices[0];
if(!is_scht[k])
{
st[k]=gcnew scht();
st[k]->label1->Text=" "+mylist->Items[k]->Text->Trim()+" …";
st[k]->CMark=k+100+(k+100)/Pemp->CMark;
st[k]->touxiang->ImageLocation=safe_cast<yonghu^ >(mytree->Nodes[st[k]->CMark-100])->CPicture;
st[k]->name=mylist->Items[k]->Text->Trim();
st[k]->pcmark=Pemp->CMark;
st[k]->bname=mytree->Nodes[Pemp->CMark-100]->Text->Trim();
st[k]->SAtClient=SAtClient;
is_scht[k]=true;
}
st[k]->Show();
st[k]->Focus();
}
//
private: System::Void xgbz_Click(System::Object^ sender, System::EventArgs^ e) {
mylist->SelectedItems[0]->BeginEdit();
}
//mylist
private: System::Void mylist_AfterLabelEdit(System::Object^ sender, System::Windows::Forms::LabelEditEventArgs^ e) {
if(e->Label==nullptr||e->Label=="")
{
e->CancelEdit=true;
return;
}
int k=e->Item;
if(k+100>=Pemp->CMark)
k++;
safe_cast<yonghu^>(mytree->Nodes[k])->Text=e->Label;
}
//
private: System::Void helpmylist_Opened(System::Object^ sender, System::EventArgs^ e) {
if(mylist->SelectedItems->Count==0)
{
fqlt->Enabled=false;
xgbz->Enabled=false;
}
else
{
fqlt->Enabled=true;
xgbz->Enabled=true;
}
}
//
private: System::Void help6_Click(System::Object^ sender, System::EventArgs^ e) {
int k=mybiglist->SelectedIndices[0];
shuxing^ sg=gcnew shuxing();
sg->Text=safe_cast<yonghu^ >(mytree->Nodes[k])->Text->Trim();
sg->pictureBox1->ImageLocation=safe_cast<yonghu^>(mytree->Nodes[k])->CPicture;
sg->name->Text=safe_cast<yonghu^ >(mytree->Nodes[k])->CName;
sg->text->Text=safe_cast<yonghu^ >(mytree->Nodes[k])->Text->Trim();
if(safe_cast<yonghu^>(mytree->Nodes[k])->CSex)
sg->sex->Text=" ♂";
else
sg->sex->Text=" ♀";
sg->Show();
}
// ,
private: System::Void btnsearch_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show(" , !");
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
for(int j=0;j<down::count;j++)
{
tabPage4->Controls->Remove(Down[j]->name);
tabPage4->Controls->Remove(Down[j]->size);
tabPage4->Controls->Remove(Down[j]->time);
tabPage4->Controls->Remove(Down[j]->speed);
tabPage4->Controls->Remove(Down[j]->pause);
tabPage4->Controls->Remove(Down[j]->cancel);
tabPage4->Controls->Remove(Down[j]->progress);
}
down::count=0;
}
};
}