// Login private void button1_Click( object sender, EventArgs e ) { MainWindow = Owner as MainForm; int iResult = MainWindow.PeerNetwork.Connect( IPADR, Port ); if( 0 == iResult ) DialogResult = DialogResult.OK; else { string szMsg = Properties.Resources.LoginForm_MessageBox_String1 + " ErrorCode:" + iResult; MessageBox.Show( this, szMsg ); } }
static void Main() { MainForm MainWidnow = null; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault( false ); MainWidnow = new MainForm(); if( null == MainWidnow ) { System.Diagnostics.Debug.WriteLine( "Failed to create the MainForm type object." ); return; } Application.Run( MainWidnow ); }