構(gòu)建一個(gè)net Remoting 程序_第1頁(yè)
構(gòu)建一個(gè)net Remoting 程序_第2頁(yè)
構(gòu)建一個(gè)net Remoting 程序_第3頁(yè)
構(gòu)建一個(gè)net Remoting 程序_第4頁(yè)
構(gòu)建一個(gè)net Remoting 程序_第5頁(yè)
已閱讀5頁(yè),還剩21頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、構(gòu)建一個(gè)net Remoting程序(真正的三層結(jié)構(gòu))_吐血推薦 HYPERLINK 2004 年 08 月 29 日 Blog fanxiaoduo構(gòu)建一個(gè)net Remoting程序(真正的三層結(jié)構(gòu))_突血推薦!NET Remoting提供了一個(gè)功能強(qiáng)大、高效的處理遠(yuǎn)程對(duì)象的方法。我在開發(fā)一個(gè)電力 軟件時(shí),由于業(yè)務(wù)量大,必須用三層結(jié)構(gòu)。實(shí)現(xiàn)數(shù)據(jù)處理(瀏覽、更新)但是這方面的資料 很少。通過(guò)摸索我找到的方法。謹(jǐn)獻(xiàn)給想用.net開發(fā)三層結(jié)構(gòu)數(shù)據(jù)庫(kù)應(yīng)用軟件而又苦于找 不到方法的C#程序員。第一步:創(chuàng)建共享庫(kù)依次點(diǎn)擊“文件”- “新創(chuàng)建”-“工程”,選擇創(chuàng)建一個(gè)C# Library,并將其命名 為

2、ydglServerLibrary,然后點(diǎn)擊OK按鈕。這將創(chuàng)建一個(gè)我們的.NET Remote客戶端和服務(wù) 器端用來(lái)通訊的“共享命令集”。正面是完整的代碼using System;using System.Runtime ;using System.Data.OleDb;using System.Data.SqlClient;using System.Data;using System.Configuration;namespace ydglServerClassLibrary1 / / Class1的摘要說(shuō)明。/ public class ydglDB:System.MarshalByRef

3、Objectprivate System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1;private System.Data.OleDb.OleDbCommand oleDbSelectCommand1;private System.Data.OleDb.OleDbCommand oleDbInsertCommand1;private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1;private System.Data.OleDb.OleDbCommand oleDbDeleteComman

4、d1;private System.Data.OleDb.OleDbConnection oleDbConnection1;private System.ComponentModel.Container components = null;public void InitializeComponent()this.oleDbDataAdapterl = new System.Data.OleDb.OleDbDataAdapter();this.oleDbSelectCommandl = new System.Data.OleDb.OleDbCommand();this.oleDbInsertC

5、ommand1 = new System.Data.OleDb.OleDbCommand();this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand();this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand();this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();/ oleDbDataAdapter1/this.oleDbDataAdapter1.DeleteCommand = th

6、is.oleDbDeleteCommand1;this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1;this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping new System.Data.Common.DataTableMapping(Table”, bm_gdfgs”, new

7、System.Data.Common.DataColumnMapping new System.Data.Common.DataCo lumnMapping(code”, code),new System.Data.Common.DataCo lumnMapping(name”, name);this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1;/ oleDbSelectCommand1/this.oleDbSelectCommand1.CommandText = SELECT code, name FROM bm_gd

8、fgs;this.oleDbSelectCommand1.Connection = this.oleDbConnection1;/ / oleDbInsertCommand1/ this.oleDblnsertCommandl.CommandText = INSERT INTO bm_gdfgs(code, name) VALUES (?, ?); SELECT code, name FROM bm_gdfgs W +HERE (code = ?);this.oleDblnsertCommandl.Connection = this.oleDbConnectionl;this.oleDbIns

9、ertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter( code, System.Data.OleDb.OleDbType.VarChar, 2, code);this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter( name, System.Data.OleDb.OleDbType.VarChar, 40, name);this.oleDbInsertCommand1.Parameters.Add(new System.D

10、ata.OleDb.OleDbParameter( Select_code, System.Data.OleDb.OleDbType.VarChar, 2, code);/ oleDbUpdateCommandl/this.oleDbUpdateCommandl.CommandText = UPDATE bm_gdfgs SET code = ?, name = ? WHERE (code = ?) AND (name = ? OR ? IS NUL +L AND name IS NULL); SELECT code, name FROM bm_gdfgs WHERE (code = ?);

11、this.oleDbUpdateCommandl.Connection = this.oleDbConnectionl; this.oleDbUpdateCommandl.Parameters.Add(new System.Data.OleDb.OleDbParameter( code, System.Data.OleDb.OleDbType.VarChar, 2, code);this.oleDbUpdateCommandl.Parameters.Add(new System.Data.OleDb.OleDbParameter( name, System.Data.OleDb.OleDbTy

12、pe.VarChar, 40, name);this.oleDbUpdateCommandl.Parameters.Add(new System.Data.OleDb.OleDbParameter( Original_code, System.Data.OleDb.OleDbType.VarChar, 2, System.Data.ParameterDirection.Inpu t, false, (System.Byte)(0), (System.Byte)(0), code, System.Data.DataRowVersion.Origina l, null);this.oleDbUpd

13、ateCommandl.Parameters.Add(new System.Data.OleDb.OleDbParameter( Original_name, System.Data.OleDb.OleDbType.VarChar, 40, System.Data.ParameterDirection.Inpu t, false, (System.Byte)(0), (System.Byte)(0), name, System.Data.DataRowVersion.Origina l, null);this.oleDbUpdateCommandl.Parameters.Add(new Sys

14、tem.Data.OleDb.OleDbParameter( Original_namel, System.Data.OleDb.OleDbType.VarChar, 40, System.Data.ParameterDirection.Inp ut, false, (System.Byte)(0), (System.Byte)(0), name, System.Data.DataRowVersion.Origin al, null);this.oleDbUpdateCommandl.Parameters.Add(new System.Data.OleDb.OleDbParameter( Se

15、lect_code, System.Data.OleDb.OleDbType.VarChar, 2, code);/ oleDbDeleteCommandl/ this.oleDbDeleteCommandl.CommandText = DELETE FROM bm_gdfgs WHERE (code = ?) AND (name = ? OR ? IS NULL AND name IS NULL +);this.oleDbDeleteCommand1.Connection = this.oleDbConnection1;this.oleDbDeleteCommand1.Parameters.

16、Add(new System.Data.OleDb.OleDbParameter( Original_code, System.Data.OleDb.OleDbType.VarChar, 2, System.Data.ParameterDirection.Inpu t, false, (System.Byte)(0), (System.Byte)(0), code, System.Data.DataRowVersion.Origina l, null);this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbPara

17、meter( Original_name, System.Data.OleDb.OleDbType.VarChar, 40, System.Data.ParameterDirection.Inpu t, false, (System.Byte)(0), (System.Byte)(0), name, System.Data.DataRowVersion.Origina l, null);this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter( Original_name1, System.Data

18、.OleDb.OleDbType.VarChar, 40, System.Data.ParameterDirection.Inp ut, false, (System.Byte)(0), (System.Byte)(0), name, System.Data.DataRowVersion.Origin al, null);/ oleDbConnection1/this.oleDbConnection1.ConnectionString = User ID=sa;Data Source=BILLGATES;Ta g with column collation when possible=Fals

19、e;Initial Catalog=ydgl;Use Procedure for Prepare=1; Auto Translate=True;Persist Security Info=False;Provider=SQLOLEDB.1;Workstation ID=BILLG ATES;Use Encryption for Data=False;Packet Size=4096;/ Service1/public DataSet Get_bm_gdfgs() DataSet ds=new DataSet();oleDbDataAdapterl.Fill(ds);return ds;publ

20、ic DataSet Update_bm_gdfgs(DataSet ds)if (ds!=null)oleDbDataAdapter1.Update(ds);return ds;elsereturn null;請(qǐng)記住,如果得到System.Runtime.Remoting.Channels.Tcp名字空間不存在的信息, 請(qǐng)檢查是否象上面的代碼那樣添加了對(duì)System.Runtime.Remoting.dll的引用。編譯創(chuàng)建的工程,就會(huì)得到一個(gè)DLL文件,并可以在其他的工程中使用它。第二步:創(chuàng)建Server對(duì)象有幾種方法可以創(chuàng)建Server對(duì)象,最直觀的方法是下面的方法:在Visual Stu

21、dio.NET中,依次點(diǎn)擊“文件”-“新創(chuàng)建”-“工程”,選擇創(chuàng)建一個(gè)“Windows Application”, 并將它命名為ydglServer。TOM相冊(cè)http/albumiom. com最最重要的是,我們需要添加對(duì)剛才在第一步中所創(chuàng)建的DLL文件的應(yīng)用,該應(yīng)用程 序才能正確地運(yùn)行。依次點(diǎn)擊“工程”- “添加引用”,然后通過(guò)點(diǎn)擊“瀏覽”按鈕添加一 個(gè)對(duì)在第一步中所創(chuàng)建的DLL文件的引用。為了使用.NET remote功能,必須通過(guò)選擇“工程”-“添加引用”,添加對(duì)DLL文件 的引用。在.NET標(biāo)簽中選擇System.Runtime.Remoting.DLL,然后點(diǎn)擊“ OK ”按鈕。然

22、后, 需要象我們?cè)诘谝徊街心菢犹砑訉?duì)System.Runtime.Remoting.dll的引用。下面的對(duì)象相當(dāng)?shù)暮?jiǎn)單和直觀,我將就真正與.NET remoting相關(guān)的3行代碼中的每一 行進(jìn)行解釋。TcpServerChannel是.NET remoting支持的二種信道類型中的一種,它將設(shè)置我們希 望我們的對(duì)象對(duì)來(lái)自哪一個(gè)端口的請(qǐng)求進(jìn)行回應(yīng),ChannelServices.ReGISterChannel將把 該端口號(hào)與操作系統(tǒng)中的TCP/IP棧綁定。TcpServerChannel channel = new TcpServerChannel(9932);ChannelServices.R

23、egisterChannel(channel);另一種可以設(shè)置的信道類型是HTTP,只要簡(jiǎn)單地使用System.Runtime.Remoting.Chan nels.Http名字空間中的HttpServerChannel對(duì)象即可搞定。使用HTTP和TCP信道之間的 區(qū)別可以簡(jiǎn)單的歸結(jié)為:如果應(yīng)用程序是在局域網(wǎng)上運(yùn)行,則最好使用TCP信道,因?yàn)樗?性能要好于HTTP信道;如果應(yīng)用程序是在互聯(lián)網(wǎng)上運(yùn)行,則有時(shí)候根據(jù)防火墻的配置,HT TP是唯一的選擇。需要記住的是,如果使用了防火墻軟件,則防火墻應(yīng)該配置成允許TCP 數(shù)據(jù)流量通過(guò)你為對(duì)象選擇的端口。RemotingConfiguration.Re

24、gisterWellKnownServiceType(typeof(ydglDB),ydglDB, WellKnownObjectMode.SingleCall);這行代碼設(shè)置了服務(wù)中的一些參數(shù)和把欲使用的對(duì)象名字與遠(yuǎn)程對(duì)象進(jìn)行綁定,第一 個(gè)參數(shù)是綁定的對(duì)象,第二個(gè)參數(shù)是TCP或HTTP信道中遠(yuǎn)程對(duì)象名字的字符串,第三個(gè)參 數(shù)讓容器知道,當(dāng)有對(duì)對(duì)象的請(qǐng)求傳來(lái)時(shí),應(yīng)該如何處理對(duì)象。盡管WellKnownObjectMode. Single對(duì)所有的調(diào)用者使用一個(gè)對(duì)象的實(shí)例,但它為每個(gè)客戶生成這個(gè)對(duì)象的一個(gè)實(shí)例。完整的對(duì)象代碼如下所示:using System;using System.Drawin

25、g;using System.Collections;using System.ComponentModel;using System. Windows.Forms;using System.Data;using System.Runtime.Remoting;using System.Runtime.Remoting.Channels;using System.Runtime.Remoting.Channels.Tcp;using ydglServerClassLibrary1;namespace ydglserver1/ / Form1的摘要說(shuō)明。/ public class Form1

26、: System.Windows.Forms.Formprivate System.Windows.Forms.PictureBox pictureBox1;private System.Windows.Forms.Button button1;private System.Windows.Forms.Button button2;private System.Windows.Forms.Button button3;private System.Windows.Forms.Label labell;private System.Windows.Forms.Label label2;priva

27、te System.Windows.Forms.Label label3;private System.Windows.Forms.ComboBox comboBox1;/ /必需的設(shè)計(jì)器變量。/ private System.ComponentModel.Container components = null;public Form1()/ Windows窗體設(shè)計(jì)器支持所必需的/InitializeComponent();/ TODO:在InitializeComponent調(diào)用后添加任何構(gòu)造函數(shù)代碼/ /清理所有正在使用的資源。/ protected override void Dispo

28、se( bool disposing )if ( disposing )if (components != null)components.Dispose();base.Dispose( disposing );#region Windows窗體設(shè)計(jì)器生成的代碼/ III設(shè)計(jì)器支持所需的方法-不要使用代碼編輯器修改/此方法的內(nèi)容。/ private void InitializeComponent() System.Resources.ResourceManager resources = new System.Resources.ResourceMana ger(typeof(Form1);

29、 this.pictureBoxl = new System.Windows.Forms.PictureBox(); this.buttonl = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.labell = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Labe

30、l(); this.label3 = new System.Windows.Forms.Label(); boBoxl = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); / / pictureBoxl / this.pictureBoxl.Image = (System.Drawing.Image)(resources.GetObject(pictureB oxl.Image); this.pictureBoxl.Location = new System.Drawing.Point(32, 96); this.pictu

31、reBoxl.Name = pictureBoxl”; this.pictureBoxl.Size = new System.Drawing.Size(56, 48); this.pictureBoxl.TabIndex = 0; this.pictureBoxl.TabStop = false; / / buttonl / this.buttonl.Image = (System.Drawing.Image)(resources.GetObject(buttonl.Imag e); this.buttonl.Location = new System.Drawing.Point(253, 5

32、2); this.buttonl.Name = buttonl; this.buttonl.Size = new System.Drawing.Size(32, 32); this.buttonl.TabIndex = l; / button2/this.button2.Image = (System.Drawing.Image)(resources.GetObject(button2.Image);this.button2.Location = new System.Drawing.Point(253, 100);this.button2.Name = button2;this.button

33、2.Size = new System.Drawing.Size(32, 32);this.button2.TabIndex = 2;/ button3/this.button3.Image = (System.Drawing.Image)(resources.GetObject(button3.Image);this.button3.Location = new System.Drawing.Point(253, 148);this.button3.Name = button3;this.button3.Size = new System.Drawing.Size(32, 32);this.

34、button3.TabIndex = 3;/ label1/this.label1.Location = new System.Drawing.Point(149, 60);this.label1.Name = label1;this.label1.Size = new System.Drawing.Size(32, 23);this.label1.TabIndex = 4;this.label1.Text = stop;/ label2/this.label2.Location = new System.Drawing.Point(149, 108);this.label2.Name = l

35、abel2;this.label2.Size = new System.Drawing.Size(40, 23);this.label2.TabIndex = 5;this.label2.Text = pause;/ label3/this.label3.Location = new System.Drawing.Point(149, 156);this.label3.Name = label3;this.label3.Size = new System.Drawing.Size(96, 23);this.label3.TabIndex = 6;this.label3.Text = start

36、/continue;/ comboBox1/boBox1.Location = new System.Drawing.Point(128, 24);boBox1.Name = comboBox1”;boBox1.Size = new System.Drawing.Size(160, 20);boBox1.TabIndex = 7;boBox1.Text = ydglserver;/ Form1/this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);this.ClientSize = new System.Drawing.Size(392

37、, 237);this.Controls.Add(boBox1);this.Controls.Add(this.label3);this.Controls.Add(this.label2);this.Controls.Add(this.label1);this.Controls.Add(this.button3);this.Controls.Add(this.button2);this.Controls.Add(this.button1);this.Controls.Add(this.pictureBox1);this.Name = Form1;this.StartPosition = Sys

38、tem.Windows.Forms.FormStartPosition.CenterScreen;this.Text =電力營(yíng)銷應(yīng)用服務(wù)器;this.Load += new System.EventHandler(this.Form1_Load);this.ResumeLayout(false);#endregion/ /應(yīng)用程序的主入口點(diǎn)。/ STAThreadstatic void Main()Application.Run(new Form1();private void Form1_Load(object sender, System.EventArgs e)注冊(cè)信道TcpChanne

39、l chan=new TcpChannel(8085);ChannelServices.RegisterChannel(chan);注冊(cè)提供服務(wù)的遠(yuǎn)程對(duì)象RemotingConfiguration.RegisterWellKnownServiceType(typeof(ydglDB),ydglDB”,Wel lKnownObjectMode.Singleton);第三步:創(chuàng)建Remote客戶端程序ydgl是我們?yōu)閷?duì)在上面創(chuàng)建的ydglServer遠(yuǎn)程對(duì)象進(jìn)行測(cè)試而創(chuàng)建的。要?jiǎng)?chuàng)建這一工 程,可以依次點(diǎn)擊“文件”-“創(chuàng)建”-“工程”,然后選擇創(chuàng)建一個(gè)windows Applicati on類型、名

40、字為ydgl的工程名。象在第二步中那樣,我們需要添加對(duì)在第一步中創(chuàng)建的D LL 文件和 System.Runtime.Remoting DLL 的引用。下面的代碼中有二行對(duì)于.NET remoting而言是特別重要的。第一行創(chuàng)建了一個(gè)TCP 客戶端信道,該信道并不是綁定在一個(gè)端口上的;第二行獲取了一個(gè)對(duì)遠(yuǎn)程的ydgldb對(duì)象 的引用。using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;

41、using System.Runtime.Remoting;using System.Runtime.Remoting.Channels;using System.Runtime.Remoting.Channels.Tcp;using ydglServerClassLibrary1;namespace WinUI/ III Forml的摘要說(shuō)明。/ public class Forml : System.Windows.Forms.Formprivate System.Windows.Forms.MainMenu mainMenul;private System.Windows.Forms.M

42、enultem menulteml;private System.Windows.Forms.Menultem menuItem2;private System.Windows.Forms.Menultem menuItem3;private System.Windows.Forms.Menultem menuItem4;private System.Windows.Forms.MenuItem menuItem5;private System.Windows.Forms.MenuItem menuItem6;private System.Windows.Forms.MenuItem menu

43、Item7;private System.Windows.Forms.MenuItem menuItem8;private System.Windows.Forms.MenuItem menuItem9;private System.Windows.Forms.MenuItem menuItemlO;private System.Windows.Forms.MenuItem menuItemll;private System.Windows.Forms.ToolBar toolBarl;private System.Windows.Forms.StatusBar statusBarl;priv

44、ate System.Windows.Forms.ToolBarButton toolBarButtonl;private System.Windows.Forms.ToolBarButton toolBarButton2;private System.Windows.Forms.ToolBarButton toolBarButton3;private System.Windows.Forms.ToolBarButton toolBarButton4;private System.Windows.Forms.ToolBarButton toolBarButton5;private System

45、.Windows.Forms.ImageList imageListl;private System.Windows.Forms. DataGrid dataGridl;private System.Windows.Forms.Button buttonl;private System.ComponentModel.IContainer components;private DataSet dsl;private System.Windows.Forms.Button button2;private ydglDB ydglDBl;public Forml()/ Windows窗體設(shè)計(jì)器支持所必

46、需的 /InitializeComponent();/ TODO:在InitializeComponent調(diào)用后添加任何構(gòu)造函數(shù)代碼/ /清理所有正在使用的資源。/ protected override void Dispose( bool disposing )if ( disposing )if (components != null)components.Dispose();base.Dispose( disposing );#region Windows窗體設(shè)計(jì)器生成的代碼/ /設(shè)計(jì)器支持所需的方法-不要使用代碼編輯器修改/此方法的內(nèi)容。/ private void Initializ

47、eComponent()ponents = new System.ComponentModel.Container();System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1);this.mainMenul = new System.Windows.Forms.MainMenu();this.menulteml = new System.Windows.Forms.MenuItem();this.menuItem6this.menuItem7newSystem.

48、Windows.Forms.MenuItem();this.menuItem9newSystem.Windows.Forms.MenuItem();this.menuItem8newSystem.Windows.Forms.MenuItem();this.menuItem2newSystem.Windows.Forms.MenuItem();this.menuItem3newSystem.Windows.Forms.MenuItem();this.menuItem4newSystem.Windows.Forms.MenuItem();this.menuItem5newSystem.Window

49、s.Forms.MenuItem();this.menuItem10 = new System.Windows.Forms.MenuItem();this.menuItem11 = new System.Windows.Forms.MenuItem();this.toolBar1 = this.toolBar1 = newthis.toolBarButton1newSystem.Windows.Forms.ToolBarButton();this.toolBarButton2newSystem.Windows.Forms.ToolBarButton();this.toolBarButton3n

50、ewSystem.Windows.Forms.ToolBarButton();this.toolBarButton4newthis.toolBarButton1newSystem.Windows.Forms.ToolBarButton();this.toolBarButton2newSystem.Windows.Forms.ToolBarButton();this.toolBarButton3newSystem.Windows.Forms.ToolBarButton();this.toolBarButton4newSystem.Windows.Forms.ToolBarButton();thi

51、s.toolBarButton5newSystem.Windows.Forms.ToolBarButton();this.imageList1 = newthis.statusBar1 = this.imageList1 = newthis.statusBar1 = newSystem.Windows.Forms.StatusBar();this.dataGrid1 = new System.Windows.Forms.DataGrid();this.button1 = new System.Windows.Forms.Button();this.button2 = new System.Wi

52、ndows.Forms.Button();(System.ComponentModel.ISupportInitialize)(this.dataGrid1).BeginInit();this.SuspendLayout();/ mainMenu1/this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem this.menuItem1,this.menuItem2,this.menuItem5);/ menuItem1/this.menuItem1.Index = 0;this.menuItem1.MenuItems

53、.AddRange(new System.Windows.Forms.MenuItem this.menuItem6,this.menuItem7,this.menuItem9,this.menuItem8);this.menuItem1.Text = &F 文件 ;/ menuItem6/this.menuItem6.Index = 0;this.menuItem6.Text =應(yīng)用服務(wù)器配置;/ menuItem7/this.menuItem7.Index = 1;this.menuItem7.Text =登錄”;/ menuItem9/this.menuItem9.Index = 2;t

54、his.menuItem9.Text =-;/ menuItem8/this.menuItem8.Index = 3;this.menuItem8.Text =退出;/ menuItem2/this.menuItem2.Index = 1;this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem this.menuItem3,this.menuItem4);this.menuItem2.Text = &W 窗口 ”;/ menuItem3/this.menuItem3.Index = 0;this.menuItem3

55、.Text =水平”;this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);/ menuItem4/this.menuItem4.Index = 1;this.menuItem4.Text =垂直”;/ menuItem5/this.menuItem5.Index = 2;this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem this.menuItem10,this.menuItem11);this.menuItem5.Text

56、 = &H 幫助”;/ menuItem10/this.menuItem10.Index = 0;this.menuItem10.Text =幫助;this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click);/ menuItem11/this.menuItem11.Index = 1;this.menuItem11.Text =關(guān)于電力營(yíng)銷管理系統(tǒng).;/this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton this.toolB

57、arButtonl,this.toolBarButton2,this.toolBarButton3,this.toolBarButton4,this.toolBarButton5);this.toolBar1.DropDownArrows = true;this.toolBar1.ImageList = this.imageList1;this.toolBar1.Location = new System.Drawing.Point(0, 0);this.toolBar1.Name = toolBar1”;this.toolBar1.ShowToolTips = true;this.toolB

58、ar1.Size = new System.Drawing.Size(1016, 28);this.toolBar1.TabIndex = 2;this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventH andler(this.toolBar1_ButtonClick);/ toolBarButton1/this.toolBarButton1.ImageIndex = 0;/ toolBarButton2/this.toolBarButton2.ImageIndex = 1;/ toolBarBu

59、tton3/this.toolBarButton3.ImageIndex = 5;/ toolBarButton4/ this.toolBarButton4.ImageIndex = 4;/ toolBarButton5/this.toolBarButton5.ImageIndex = 3;/ imageList1/this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;this.imageList1.ImageSize = new System.Drawing.Size(16, 16);this.imag

60、eList1.ImageStream = (System.Windows.Forms.ImageListStreamer)(resour ces.GetObject(imageList1.ImageStream);this.imageList1.TransparentColor = System.Drawing.Color.Transparent;/ statusBar1/this.statusBar1.Location = new System.Drawing.Point(0, 699);this.statusBar1.Name = statusBar1”;this.statusBar1.S

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論