This is the start of the server code

Size: px
Start display at page:

Download "This is the start of the server code"

Transcription

1 This is the start of the server code using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.Net.Sockets; using System.Threading; using System.Text; namespace csharpserver / <summary> / Summary description for Form1. / </summary> public class Form1 : System.Windows.Forms.Form private System.Windows.Forms.ListBox conlist; private System.Windows.Forms.ListBox namelist; private System.Windows.Forms.Button exitbutton; / <summary> / Required designer variable. / </summary> private System.ComponentModel.Container components = null; public Form1() Required for Windows Form Designer support InitializeComponent(); TODO: Add any constructor code after InitializeComponent call / <summary> / Clean up any resources being used. / </summary> protected override void Dispose( bool disposing ) if( disposing )

2 if (components!= null) components.dispose(); base.dispose( disposing ); #region Windows Form Designer generated code / <summary> / Required method for Designer support - do not modify / the contents of this method with the code editor. / </summary> Thread listenthread; Thread[] clithread; int newcon; Socket[] ssock; Socket tcplist; private void InitializeComponent() this.conlist = new System.Windows.Forms.ListBox(); this.namelist = new System.Windows.Forms.ListBox(); this.exitbutton = new System.Windows.Forms.Button(); this.suspendlayout(); conlist this.conlist.items.addrange(new object[] "empty", 24); 24); 160); (152, 208); "empty"); this.conlist.location = new System.Drawing.Point(24, this.conlist.name = "conlist"; this.conlist.size = new System.Drawing.Size(160, 160); this.conlist.tabindex = 0; namelist this.namelist.location = new System.Drawing.Point(232, this.namelist.name = "namelist"; this.namelist.size = new System.Drawing.Size(176, this.namelist.tabindex = 1; exitbutton this.exitbutton.location = new System.Drawing.Point

3 this.exitbutton.name = "exitbutton"; this.exitbutton.size = new System.Drawing.Size(136, 40); this.exitbutton.tabindex = 2; this.exitbutton.text = "Exit"; this.exitbutton.click += new System.EventHandler (this.exitbutton_click); Form1 this.autoscalebasesize = new System.Drawing.Size(5, 13); this.clientsize = new System.Drawing.Size(440, 266); this.controls.addrange(new System.Windows.Forms.Control[] this.exitbutton, this.namelist, _Closing); this.conlist); this.name = "Form1"; this.text = "Form1"; this.load += new System.EventHandler(this.Form1_Load); this.closing += new CancelEventHandler(this.Form1 this.resumelayout(false); #endregion / <summary> / The main entry point for the application. / </summary> [STAThread] static void Main() Application.Run(new Form1()); private void Form1_Load(object sender, EventArgs e) int i; conlist.items.clear(); namelist.items.clear(); clithread = new Thread[50]; ssock = new Socket[50]; for (i=0;i<50;i++) conlist.items.add("no Connection"); namelist.items.add("");

4 (listenproc)); listenthread = new Thread(new ThreadStart listenthread.start(); private void Form1_Closing(object sender, CancelEventArgs e) int i; byte[] bytes; string byemessage; byemessage="bye@"; bytes=encoding.ascii.getbytes(byemessage); for (i=0;i<50;i++) if (namelist.items[i].tostring()!= "") ssock[i].send(bytes); clithread[i].abort(); tcplist.close(); listenthread.abort(); public void cliproc() int clientno; clientno = newcon; listenthread.resume(); string data,newdata; int bytesrec,dataptr; byte[] bytes; string towho,fromwho; string tempstring,message; int firstat,lendata,curlen,i; fromwho = namelist.items[clientno].tostring() + "@"; recvnext:

5 while(ssock[clientno].available == 0); bytesrec = ssock[clientno].receive(bytes); data = Encoding.ASCII.GetString(bytes); firstat = data.indexof("@"); tempstring = data.substring(0,firstat); lendata = Int32.Parse(tempstring); curlen = bytesrec; while (curlen<lendata) bytesrec = ssock[clientno].receive(bytes); data += Encoding.ASCII.GetString(bytes); curlen += bytesrec; dataptr = data.indexof("@",firstat+1); towho = data.substring(firstat+1,dataptr-firstat-1); if (towho=="bye") namelist.items.insert(clientno,""); namelist.items.removeat(clientno+1); conlist.items.insert(clientno,"no Connection"); conlist.items.removeat(clientno+1); data = "names@"; (); for (i=0;i<50;i++) if (namelist.items[i].tostring()!= "") data += namelist.items[i].tostring data += "@"; for (i=0;i<50;i++) if (namelist.items[i].tostring()!= "") ssock[i].send (Encoding.ASCII.GetBytes(data));

6 clithread[clientno].abort(); if (towho!= "bye") message = data.substring(dataptr+1,lendatadataptr-1); i = 0; while (namelist.items[i].tostring()!= towho) i++; newdata = fromwho + message; bytes = Encoding.ASCII.GetBytes(newdata); ssock[i].send(bytes); goto recvnext; public void listenproc() IPHostEntry iphostinfo = Dns.Resolve(Dns.GetHostName ()); IPAddress ipaddress = iphostinfo.addresslist[0]; IPEndPoint localendpoint = new IPEndPoint(ipAddress, 13); tcplist = new Socket (AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); keeplistening: tcplist.blocking=true; tcplist.bind(localendpoint); tcplist.listen(10); Connection") newcon=0; while( conlist.items[newcon].tostring()!= "No

7 ; newcon++; ssock[newcon]=tcplist.accept(); conlist.items.remove(newcon); conlist.items.insert(newcon,((ipendpoint)ssock [newcon].remoteendpoint).address.tostring()); byte[] bytes; int bytesrec; string data; bytesrec = ssock[newcon].receive(bytes); data = Encoding.ASCII.GetString(bytes,0,bytesrec); namelist.items.remove(newcon); namelist.items.insert(newcon,data); int i; data = "names@"; for (i=0;i<50;i++) if (namelist.items[i].tostring()!= "") data += namelist.items[i].tostring()+"@"; bytes = Encoding.ASCII.GetBytes(data); for (i=0;i<50;i++) if (namelist.items[i].tostring()!= "") ssock[i].send(bytes); (cliproc)); clithread[newcon] = new Thread(new ThreadStart clithread[newcon].start(); listenthread.suspend(); goto keeplistening; private void exitbutton_click(object sender, System.EventArgs e)

8 int i; byte[] bytes; string byemessage; bytes=encoding.ascii.getbytes(byemessage); for (i=0;i<50;i++) if (namelist.items[i].tostring()!= "") ssock[i].send(bytes); clithread[i].abort(); tcplist.close(); listenthread.abort(); Application.Exit(); This is where the client code begins using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.Net.Sockets; using System.Threading; using System.Text; namespace csharpclient

9 / <summary> / Summary description for Form1. / </summary> public class Form1 : System.Windows.Forms.Form / <summary> / Required designer variable. / </summary> private System.ComponentModel.Container components = null; public Form1() Required for Windows Form Designer support InitializeComponent(); TODO: Add any constructor code after InitializeComponent call / <summary> / Clean up any resources being used. / </summary> protected override void Dispose( bool disposing ) if( disposing ) if (components!= null) components.dispose(); base.dispose( disposing ); #region Windows Form Designer generated code / <summary> / Required method for Designer support - do not modify / the contents of this method with the code editor. / </summary> / Socket csock; Thread recvthread; IPEndPoint endpoint; private System.Windows.Forms.TextBox yourname; private System.Windows.Forms.Button cbut; private System.Windows.Forms.TextBox sendbox; private System.Windows.Forms.Button sendbut;

10 private System.Windows.Forms.TextBox recbox; private System.Windows.Forms.ListBox theirnames; 40); private void InitializeComponent() this.yourname = new System.Windows.Forms.TextBox(); this.cbut = new System.Windows.Forms.Button(); this.sendbox = new System.Windows.Forms.TextBox(); this.sendbut = new System.Windows.Forms.Button(); this.recbox = new System.Windows.Forms.TextBox(); this.theirnames = new System.Windows.Forms.ListBox(); this.suspendlayout(); yourname this.yourname.location = new System.Drawing.Point(40, this.yourname.name = "yourname"; this.yourname.size = new System.Drawing.Size(248, 20); this.yourname.tabindex = 0; this.yourname.text = "bruce"; cbut this.cbut.location = new System.Drawing.Point(328, 32); this.cbut.name = "cbut"; this.cbut.size = new System.Drawing.Size(152, 48); this.cbut.tabindex = 1; this.cbut.text = "button1"; this.cbut.click += new System.EventHandler (this.cbut_click); sendbox this.sendbox.location = new System.Drawing.Point(24, 176); this.sendbox.multiline = true; this.sendbox.name = "sendbox"; this.sendbox.size = new System.Drawing.Size(512, 184); this.sendbox.tabindex = 2; this.sendbox.text = "textbox2"; sendbut this.sendbut.location = new System.Drawing.Point(32, 368); this.sendbut.name = "sendbut"; this.sendbut.size = new System.Drawing.Size(496, 32); this.sendbut.tabindex = 3; this.sendbut.text = "button2"; this.sendbut.click += new System.EventHandler (this.sendbut_click);

11 416); (32, 80); 56); recbox this.recbox.acceptsreturn = true; this.recbox.location = new System.Drawing.Point(32, this.recbox.multiline = true; this.recbox.name = "recbox"; this.recbox.size = new System.Drawing.Size(488, 184); this.recbox.tabindex = 4; this.recbox.text = "textbox3"; theirnames this.theirnames.location = new System.Drawing.Point this.theirnames.name = "theirnames"; this.theirnames.size = new System.Drawing.Size(272, this.theirnames.tabindex = 5; Form1 this.autoscalebasesize = new System.Drawing.Size(5, 13); this.clientsize = new System.Drawing.Size(568, 629); this.controls.addrange(new System.Windows.Forms.Control[] #endregion this.theirnames, this.recbox, this.sendbut, this.sendbox, this.cbut, this.yourname); this.name = "Form1"; this.text = "Form1"; this.load += new System.EventHandler(this.Form1_Load); this.resumelayout(false); / <summary> / The main entry point for the application. / </summary> [STAThread] static void Main()

12 Application.Run(new Form1()); private void Form1_Load(object sender, System.EventArgs e) cbut.text = "Connect"; yourname.text = "bruce"; recbox.text = ""; sendbox.text = ""; sendbut.text = "Send"; theirnames.items.clear(); endpoint = new IPEndPoint(Dns.Resolve ("Newdig1").AddressList[0],13); public void recvproc() int recbytes,tpoint,npoint; byte[] bytes; string data,tempstring,crstring; int atptr; byte[] cr; cr = new byte[2]; cr[0] = 10; cr[1] = 13; cr = Encoding.ASCII.GetBytes("\n"); crstring = Encoding.ASCII.GetString(cr); recvloop: while (csock.available==0); recbytes = csock.receive(bytes); data = Encoding.ASCII.GetString(bytes); atptr = data.indexof("@"); tempstring = data.substring(0,atptr); MessageBox.Show(data); if (tempstring == "names") tpoint = 6; theirnames.items.clear(); while (tpoint<recbytes)

13 - tpoint); endnameget: npoint = 1; npoint = data.indexof("@",tpoint+1); if (npoint == -1) tpoint = recbytes; goto recvloop; tempstring = data.substring(tpoint,npoint theirnames.items.add(tempstring); tpoint=npoint+1; goto recvloop; if (tempstring == "bye") MessageBox.Show("The Server has Left"); csock.shutdown(socketshutdown.both); csock.close(); theirnames.items.clear(); cbut.text = "Connect"; recvthread.abort(); if (tempstring!="bye" tempstring!="names") atptr = data.indexof("@"); tempstring = data.substring(0,atptr); "+tempstring+"\r\n"); recbox.appendtext("received from : tempstring = data.substring(atptr+1,recbytesatptr-1); recbox.appendtext(tempstring+"\r\n\r\n"); goto recvloop; private void cbut_click(object sender, System.EventArgs e) int recbytes; byte[] bytes; string data;

14 if (yourname.text == "") MessageBox.Show("You Must Specify a Username"); goto endcbutsub; if (cbut.text == "Connect") cbut.text = "Disconnect"; csock = new Socket (AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); csock.connect(endpoint); bytes = Encoding.ASCII.GetBytes(yourname.Text); csock.send(bytes); recvthread = new Thread(new ThreadStart (recvproc)); recvthread.isbackground = true; recvthread.start(); goto endcbutsub; if (cbut.text == "Disconnect") endcbutsub: data = "6@bye@"; bytes = Encoding.ASCII.GetBytes(data); csock.send(bytes); csock.shutdown(socketshutdown.both); cbut.text = "Connect"; recvthread.abort(); theirnames.items.clear(); ; MessageBox.Show("LOgged In"); e) private void sendbut_click(object sender, System.EventArgs string towho,lendata,message,data; int lenint; byte[] bytes; To"); if (theirnames.selectedindex == -1) MessageBox.Show("You Must Select a User to Send

15 goto endsend; towho = theirnames.items [theirnames.selectedindex].tostring()+"@"; message = towho+sendbox.text; lenint = message.length; if (lenint<7) lenint = lenint+2; goto nextstep; if (lenint<96 ) lenint = lenint+3; goto nextstep; if (lenint<995) lenint = lenint + 4; goto nextstep; nextstep: lendata = lenint.tostring()+"@"; data = lendata+message; MessageBox.Show(data); bytes = Encoding.ASCII.GetBytes(data); csock.send(bytes); endsend: ;

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

Classes in C# namespace classtest { public class myclass { public myclass() { } } } Classes in C# A class is of similar function to our previously used Active X components. The difference between the two is the components are registered with windows and can be shared by different applications,

More information

The New Brew-CQ Synchronous Sockets and Threading

The New Brew-CQ Synchronous Sockets and Threading The New Brew-CQ Synchronous Sockets and Threading Server Topology: The Brew-CQ server is an application written in the new.net compilers from Microsoft. The language of choice is Visual Basic. The purpose

More information

User-Defined Controls

User-Defined Controls C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic Outline 6.1 Test-Driving the Enhanced Inventory Application 6.2 Variables 6.3 Handling the TextChanged

More information

Tutorial 5 Completing the Inventory Application Introducing Programming

Tutorial 5 Completing the Inventory Application Introducing Programming 1 Tutorial 5 Completing the Inventory Application Introducing Programming Outline 5.1 Test-Driving the Inventory Application 5.2 Introduction to C# Code 5.3 Inserting an Event Handler 5.4 Performing a

More information

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6.

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6. C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL:

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL: Send SMS via SOAP API Introduction You can seamlessly integrate your applications with aql's outbound SMS messaging service via SOAP using our SOAP API. Sending messages via the SOAP gateway WSDL file

More information

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0. Sub To Srt Converter This is the source code of this program. It is made in C# with.net 2.0. form1.css /* * Name: Sub to srt converter * Programmer: Paunoiu Alexandru Dumitru * Date: 5.11.2007 * Description:

More information

CALCULATOR APPLICATION

CALCULATOR APPLICATION CALCULATOR APPLICATION Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

Lampiran B. Program pengendali

Lampiran B. Program pengendali Lampiran B Program pengendali #pragma once namespace serial using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms;

More information

LISTING PROGRAM. //Find the maximum and minimum values in the array int maxvalue = integers[0]; //start with first element int minvalue = integers[0];

LISTING PROGRAM. //Find the maximum and minimum values in the array int maxvalue = integers[0]; //start with first element int minvalue = integers[0]; 1 LISTING PROGRAM using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace SortingApplication static class Program / / The main entry point for

More information

Inheriting Windows Forms with Visual C#.NET

Inheriting Windows Forms with Visual C#.NET Inheriting Windows Forms with Visual C#.NET Overview In order to understand the power of OOP, consider, for example, form inheritance, a new feature of.net that lets you create a base form that becomes

More information

Avoiding KeyStrokes in Windows Applications using C#

Avoiding KeyStrokes in Windows Applications using C# Avoiding KeyStrokes in Windows Applications using C# In keeping with the bcrypt.exe example cited elsewhere on this site, we seek a method of avoiding using the keypad to enter pass words and/or phrases.

More information

Blank Form. Industrial Programming. Discussion. First Form Code. Lecture 8: C# GUI Development

Blank Form. Industrial Programming. Discussion. First Form Code. Lecture 8: C# GUI Development Blank Form Industrial Programming Lecture 8: C# GUI Development Industrial Programming 1 Industrial Programming 2 First Form Code using System; using System.Drawing; using System.Windows.Forms; public

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; Exercise 9.3 In Form1.h #pragma once #include "Form2.h" Add to the beginning of Form1.h #include #include For srand() s input parameter namespace Tst_Form using namespace System; using

More information

Web Services in.net (2)

Web Services in.net (2) Web Services in.net (2) These slides are meant to be for teaching purposes only and only for the students that are registered in CSE4413 and should not be published as a book or in any form of commercial

More information

C# and.net (1) cont d

C# and.net (1) cont d C# and.net (1) cont d Acknowledgements and copyrights: these slides are a result of combination of notes and slides with contributions from: Michael Kiffer, Arthur Bernstein, Philip Lewis, Hanspeter Mφssenbφck,

More information

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects 1 Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects Outline 19.1 Test-Driving the Microwave Oven Application 19.2 Designing the Microwave Oven Application 19.3 Adding a New

More information

CHAPTER 3. Writing Windows C# Programs. Objects in C#

CHAPTER 3. Writing Windows C# Programs. Objects in C# 90 01 pp. 001-09 r5ah.ps 8/1/0 :5 PM Page 9 CHAPTER 3 Writing Windows C# Programs 5 9 Objects in C# The C# language has its roots in C++, Visual Basic, and Java. Both C# and VB.Net use the same libraries

More information

Visual Studio Windows Form Application #1 Basic Form Properties

Visual Studio Windows Form Application #1 Basic Form Properties Visual Studio Windows Form Application #1 Basic Form Properties Dr. Thomas E. Hicks Computer Science Department Trinity University Purpose 1] The purpose of this tutorial is to show how to create, and

More information

this.openfiledialog = new System.Windows.Forms.OpenFileDialog(); this.label4 = new System.Windows.Forms.Label(); this.

this.openfiledialog = new System.Windows.Forms.OpenFileDialog(); this.label4 = new System.Windows.Forms.Label(); this. form.designer.cs namespace final { partial class Form1 { private System.ComponentModel.IContainer components = null; should be disposed; otherwise, false. protected override void Dispose(bool disposing)

More information

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un numar binar, in numar zecimal. Acest program are 4 numericupdown-uri

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

CIS 3260 Sample Final Exam Part II

CIS 3260 Sample Final Exam Part II CIS 3260 Sample Final Exam Part II Name You may now use any text or notes you may have. Computers may NOT be used. Vehicle Class VIN Model Exhibit A Make Year (date property/data type) Color (read-only

More information

and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1

and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1 Chapter 6 How to code methods and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Given the specifications for a method, write the method. 2. Give

More information

Operatii pop si push-stiva

Operatii pop si push-stiva Operatii pop si push-stiva Aplicatia realizata in Microsoft Visual Studio C++ 2010 permite simularea operatiilor de introducere si extragere a elementelor dintr-o structura de tip stiva.pentru aceasta

More information

UNIT-3. Prepared by R.VINODINI 1

UNIT-3. Prepared by R.VINODINI 1 Prepared by R.VINODINI 1 Prepared by R.VINODINI 2 Prepared by R.VINODINI 3 Prepared by R.VINODINI 4 Prepared by R.VINODINI 5 o o o o Prepared by R.VINODINI 6 Prepared by R.VINODINI 7 Prepared by R.VINODINI

More information

PS2 Random Walk Simulator

PS2 Random Walk Simulator PS2 Random Walk Simulator Windows Forms Global data using Singletons ArrayList for storing objects Serialization to Files XML Timers Animation This is a fairly extensive Problem Set with several new concepts.

More information

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at: This document describes how to create a simple Windows Forms Application using some Open Core Interface functions in C# with Microsoft Visual Studio Express 2013. 1 Preconditions The Open Core Interface

More information

class Class1 { /// <summary> /// The main entry point for the application. /// </summary>

class Class1 { /// <summary> /// The main entry point for the application. /// </summary> Project 06 - UDP Client/Server Applications In this laboratory project you will build a number of Client/Server applications using C# and the.net framework. The first will be a simple console application

More information

USB Logic Analyzer Shom Bandopadhaya Advisor: Dr. James H. Irwin

USB Logic Analyzer Shom Bandopadhaya Advisor: Dr. James H. Irwin Shom Bandopadhaya: USB Logic Analyzer October 13, 2005 USB Logic Analyzer Shom Bandopadhaya Advisor: Dr. James H. Irwin Introduction: The goal of this project is to continue design for a USB logic analyzer

More information

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline 11-12am 12-1pm: 1-1:45pm 1:45-2pm:, Overview of.net Framework,.NET Components, C#. C# Language Elements Classes, Encapsulation, Object-Orientation,

More information

SMITE API Developer Guide TABLE OF CONTENTS

SMITE API Developer Guide TABLE OF CONTENTS SMITE API Developer Guide TABLE OF CONTENTS TABLE OF CONTENTS DOCUMENT CHANGE HISTORY GETTING STARTED Introduction Registration Credentials Sessions API Access Limits API METHODS & PARAMETERS APIs Connectivity

More information

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

if (say==0) { k.commandtext = Insert into kullanici(k_adi,sifre) values(' + textbox3.text + ',' + textbox4.text + '); k. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient;

More information

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Classes and Objects Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline 11-12am 12-1pm: 1-1:45pm 1:45-2pm:, Overview of.net Framework,.NET Components, C#. C# Language Elements Classes,

More information

CSIS 1624 CLASS TEST 6

CSIS 1624 CLASS TEST 6 CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed

More information

UNIT III APPLICATION DEVELOPMENT ON.NET

UNIT III APPLICATION DEVELOPMENT ON.NET UNIT III APPLICATION DEVELOPMENT ON.NET Syllabus: Building Windows Applications, Accessing Data with ADO.NET. Creating Skeleton of the Application Select New->Project->Visual C# Projects->Windows Application

More information

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Classes and Objects Andrew Cumming, SoC Introduction to.net Bill Buchanan, SoC W.Buchanan (1) Course Outline Introduction to.net Day 1: Morning Introduction to Object-Orientation, Introduction to.net,

More information

Flag Quiz Application

Flag Quiz Application T U T O R I A L 17 Objectives In this tutorial, you will learn to: Create and initialize arrays. Store information in an array. Refer to individual elements of an array. Sort arrays. Use ComboBoxes to

More information

Web Services in.net (7)

Web Services in.net (7) Web Services in.net (7) These slides are meant to be for teaching purposes only and only for the students that are registered in CSE4413 and should not be published as a book or in any form of commercial

More information

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using 1 using System; 2 using System.Diagnostics; 3 using System.Collections.Generic; 4 using System.ComponentModel; 5 using System.Data; 6 using System.Drawing; 7 using System.Text; 8 using System.Windows.Forms;

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 12 Visual Basic/C# Programming (330) REGIONAL 2017 Production Portion: Program 1: Calendar Analysis (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores

More information

Lucrare pentru colocviu de practică

Lucrare pentru colocviu de practică Roman Radu-Alexandru Calculatoare an II Lucrare pentru colocviu de practică Descriere: Aplicatia are ca scop functionalitatea unui decodificator si a unui codificator. Converteste un numar din zecimal

More information

XNA 4.0 RPG Tutorials. Part 11b. Game Editors

XNA 4.0 RPG Tutorials. Part 11b. Game Editors XNA 4.0 RPG Tutorials Part 11b Game Editors I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials on

More information

Web Services in.net (6) cont d

Web Services in.net (6) cont d Web Services in.net (6) cont d These slides are meant to be for teaching purposes only and only for the students that are registered in CSE3403 and should not be published as a book or in any form of commercial

More information

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

CSC 330 Object-Oriented Programming. Encapsulation

CSC 330 Object-Oriented Programming. Encapsulation CSC 330 Object-Oriented Programming Encapsulation Implementing Data Encapsulation using Properties Use C# properties to provide access to data safely data members should be declared private, with public

More information

#pragma comment(lib, "irrklang.lib") #include <windows.h> namespace SuperMetroidCraft {

#pragma comment(lib, irrklang.lib) #include <windows.h> namespace SuperMetroidCraft { Downloaded from: justpaste.it/llnu #pragma comment(lib, "irrklang.lib") #include namespace SuperMetroidCraft using namespace System; using namespace System::ComponentModel; using namespace

More information

Object oriented lab /second year / review/lecturer: yasmin maki

Object oriented lab /second year / review/lecturer: yasmin maki 1) Examples of method (function): Note: the declaration of any method is : method name ( parameters list ).. Method body.. Access modifier : public,protected, private. Return

More information

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2 Class Test 4 Marks will be deducted for each of the following: -5 for each class/program that does not contain your name and student number at the top. -2 If program is named anything other than Question1,

More information

The Network. Multithreading. This tutorial can be found on -

The Network. Multithreading. This tutorial can be found on - This tutorial can be found on - http://www.informit.com/articles/article.aspx?p=25462&seqnum=5 Instant messaging is sweeping the world, and is rapidly replacing email as the preferred electronic communications

More information

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How to Download a File in the Background 15 How to Implement

More information

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock. C# Tutorial - Create a YouTube Alarm Clock in Visual Studio In this tutorial we will create a simple yet elegant YouTube alarm clock in Visual Studio using C# programming language. The main idea for this

More information

.NET XML Web Services

.NET XML Web Services .NET XML Web Services Bill Buchanan Course Outline Day 1: Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components. C#. Introduction to Visual Studio Environment..

More information

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components. C#. Day 1: Afternoon

More information

Laboratorio di Ingegneria del Software

Laboratorio di Ingegneria del Software Laboratorio di Ingegneria del Software L-A Interfaccia utente System.Windows.Forms The System.Windows.Forms namespace contains classes for creating Windows-based applications The classes can be grouped

More information

IBSDK Quick Start Tutorial for C# 2010

IBSDK Quick Start Tutorial for C# 2010 IB-SDK-00003 Ver. 3.0.0 2012-04-04 IBSDK Quick Start Tutorial for C# 2010 Copyright @2012, lntegrated Biometrics LLC. All Rights Reserved 1 QuickStart Project C# 2010 Example Follow these steps to setup

More information

Laboratorio di Ingegneria del L-A

Laboratorio di Ingegneria del L-A Software L-A Interfaccia utente System.Windows.Forms The System.Windows.Forms namespace contains classes for creating Windows-based applications The classes can be grouped into the following categories:

More information

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky Brian Kiser November 2010 Vigilant C# 2.5 Commonwealth of Kentucky Frankfort, Kentucky Table of Contents 1.0 Work Sample Description Page 3 2.0 Skills Demonstrated 2.1 Software development competency using

More information

} } public void getir() { DataTable dt = vt.dtgetir("select* from stok order by stokadi");

} } public void getir() { DataTable dt = vt.dtgetir(select* from stok order by stokadi); Form1 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Objectives : 1) To understand the how Windows Forms in the Windows-based applications. 2) To create a Window Application

More information

CSC 211 Intermediate Programming

CSC 211 Intermediate Programming Introduction CSC 211 Intermediate Programming Graphical User Interface Concepts: Part 1 Graphical user interface Allow interaction with program visually Give program distinct look and feel Built from window

More information

The contents of this document are directly taken from the EPiServer SDK. Please see the SDK for further technical information about EPiServer.

The contents of this document are directly taken from the EPiServer SDK. Please see the SDK for further technical information about EPiServer. Web Services Product version: 4.50 Document version: 1.0 Document creation date: 04-05-2005 Purpose The contents of this document are directly taken from the EPiServer SDK. Please see the SDK for further

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample.

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample. How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample. Author: Carlos Kassab Date: July/24/2006 First install BOBS(BaaN Ole Broker Server), you

More information

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button Create an Interest Calculator with C# In This tutorial we will create an interest calculator in Visual Studio using C# programming Language. Programming is all about maths now we don t need to know every

More information

Professional ASP.NET Web Services : Asynchronous Programming

Professional ASP.NET Web Services : Asynchronous Programming Professional ASP.NET Web Services : Asynchronous Programming To wait or not to wait; that is the question! Whether or not to implement asynchronous processing is one of the fundamental issues that a developer

More information

DotNetProcessing Documentation

DotNetProcessing Documentation DotNetProcessing Documentation DotNetProcessing Documentation Table of Contents DotNetProcessing Documentation...1 Jonatan Rubio...1 Santi Serrano...1 I. User Documentation...3 Chapter 1. Introduction...4

More information

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components. C#. Day 1: Afternoon

More information

The Payroll User Interface: MODEL VIEW PRESENTER

The Payroll User Interface: MODEL VIEW PRESENTER agile.book Page 637 Friday, June 23, 2006 9:34 AM 38 The Payroll User Interface: MODEL VIEW PRESENTER As far as the customer is concerned, the Interface is the product. Jef Raskin Our payroll application

More information

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued XNA 4.0 RPG Tutorials Part 24 Level Editor Continued I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

Polymorphism. Polymorphism. CSC 330 Object Oriented Programming. What is Polymorphism? Why polymorphism? Class-Object to Base-Class.

Polymorphism. Polymorphism. CSC 330 Object Oriented Programming. What is Polymorphism? Why polymorphism? Class-Object to Base-Class. Polymorphism CSC 0 Object Oriented Programming Polymorphism is considered to be a requirement of any true -oriented programming language (OOPL). Reminder: What are the other two essential elements in OOPL?

More information

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent()

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() A-1 LISTING PROGRAM Form Mainform /* * Created by SharpDevelop. * User: Roni Anggara * Date: 5/17/2016 * Time: 8:52 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using

More information

Representing Recursive Relationships Using REP++ TreeView

Representing Recursive Relationships Using REP++ TreeView Representing Recursive Relationships Using REP++ TreeView Author(s): R&D Department Publication date: May 4, 2006 Revision date: May 2010 2010 Consyst SQL Inc. All rights reserved. Representing Recursive

More information

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below. APPENDIX 1 TABLE DETAILS Mainly three tables namely Teacher, Student and Class for small database of a school are used. The snapshots of all three tables are shown below. Details of Class table are shown

More information

Click on the empty form and apply the following options to the properties Windows.

Click on the empty form and apply the following options to the properties Windows. Start New Project In Visual Studio Choose C# Windows Form Application Name it SpaceInvaders and Click OK. Click on the empty form and apply the following options to the properties Windows. This is the

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 16 Visual Basic/C# Programming (330) REGIONAL 2016 Program: Character Stats (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores and answer keys! Property

More information

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) )

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) insert into bolumler values(1,'elektrik') insert into bolumler values(2,'makina') insert into bolumler

More information

Network Operation System. netstat. ipconfig/tracert/ping. nslookup EEE 448 Computer Networks

Network Operation System. netstat. ipconfig/tracert/ping. nslookup EEE 448 Computer Networks EEE 448 Computer Networks with (Network Programming) Lecture #4 Dept of Electrical and Electronics Engineering Çukurova University Network Operation System When you are on the internet or are working in

More information

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); }

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); } เว บแอพล เคช น using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace

More information

Chapter 13 Working with Threads

Chapter 13 Working with Threads Chapter 13 Working with Threads Until relatively recently only advanced programmers understood and knew how to employ threads in application programs. Part of the problem was that using threads was not

More information

Eyes of the Dragon - XNA Part 37 Map Editor Revisited

Eyes of the Dragon - XNA Part 37 Map Editor Revisited Eyes of the Dragon - XNA Part 37 Map Editor Revisited I'm writing these tutorials for the XNA 4.0 framework. Even though Microsoft has ended support for XNA it still runs on all supported operating systems

More information

Writing Your First Autodesk Revit Model Review Plug-In

Writing Your First Autodesk Revit Model Review Plug-In Writing Your First Autodesk Revit Model Review Plug-In R. Robert Bell Sparling CP5880 The Revit Model Review plug-in is a great tool for checking a Revit model for matching the standards your company has

More information

Huw Talliss Data Structures and Variables. Variables

Huw Talliss Data Structures and Variables. Variables Data Structures and Variables Variables The Regex class represents a read-only regular expression. It also contains static methods that allow use of other regular expression classes without explicitly

More information

Start Visual Studio, create a new project called Helicopter Game and press OK

Start Visual Studio, create a new project called Helicopter Game and press OK C# Tutorial Create a helicopter flying and shooting game in visual studio In this tutorial we will create a fun little helicopter game in visual studio. You will be flying the helicopter which can shoot

More information

Ether I/O 24 DIP R Datasheet

Ether I/O 24 DIP R Datasheet ETHER I/O 24 DIP R Digital I/O Module The ETHER I/O 24 DIP R shown in Diagram 1 is the Dual In-Line Package equivalent of our existing Ether I/O 24 R. The Ether I/O 24 is an integrated, micro-controller

More information

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Before you start - download the game assets from above or on MOOICT.COM to

More information

Chapter 12 - Graphical User Interface Concepts: Part 1

Chapter 12 - Graphical User Interface Concepts: Part 1 Chapter 12 - Graphical User Interface Concepts: Part 1 1 12.1 Introduction 12.2 Windows Forms 12.3 Event-Handling Model 12.3.1 Basic Event Handling 12.4 Control Properties and Layout 12.5 Labels, TextBoxes

More information

Conventions in this tutorial

Conventions in this tutorial This document provides an exercise using Digi JumpStart for Windows Embedded CE 6.0. This document shows how to develop, run, and debug a simple application on your target hardware platform. This tutorial

More information

ETHER IO24 TCP DIP. Ether IO24 TCP DIP Datasheet. Module Features. Part Number: PRO EIO24 TCP DIP 2013 Elexol Pty Ltd Revision 1.5

ETHER IO24 TCP DIP. Ether IO24 TCP DIP Datasheet. Module Features. Part Number: PRO EIO24 TCP DIP 2013 Elexol Pty Ltd Revision 1.5 1 ETHER IO24 TCP DIP The Ether IO24 TCP DIP (Originally named the Ether IO24 PIC R DIP) is an integrated, micro controller based network interface board with 24 digital user I/O lines. The module s firmware

More information

Step 1: Start a GUI Project. Start->New Project->Visual C# ->Windows Forms Application. Name: Wack-A-Gopher. Step 2: Add Content

Step 1: Start a GUI Project. Start->New Project->Visual C# ->Windows Forms Application. Name: Wack-A-Gopher. Step 2: Add Content Step 1: Start a GUI Project Start->New Project->Visual C# ->Windows Forms Application Name: Wack-A-Gopher Step 2: Add Content Download the Content folder (content.zip) from Canvas and unzip in a location

More information

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer C# Tutorial Create a Motivational Quotes Viewer Application in Visual Studio In this tutorial we will create a fun little application for Microsoft Windows using Visual Studio. You can use any version

More information

Quick Guide for the ServoWorks.NET API 2010/7/13

Quick Guide for the ServoWorks.NET API 2010/7/13 Quick Guide for the ServoWorks.NET API 2010/7/13 This document will guide you through creating a simple sample application that jogs axis 1 in a single direction using Soft Servo Systems ServoWorks.NET

More information

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

string spath; string sedifile = 277_005010X228.X12; string sseffile = 277_005010X228.SemRef.EVAL0.SEF; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

JAYARAM. Department of Information Technology QUESTION BANK UNIT I BASICS OF C# Integer real single character string

JAYARAM. Department of Information Technology QUESTION BANK UNIT I BASICS OF C# Integer real single character string Estd: 1994 JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli - 621014 (An approved by AICTE and Affiliated to Anna University) ISO 9001:2000 Certified Department of Information

More information

Projects. Multiple Forms. Multiple forms. Part I. Multiple Forms

Projects. Multiple Forms. Multiple forms. Part I. Multiple Forms Projects Multiple Forms Calculator due tonight at midnight Instructions for submitting on the webpage Project 2 will be posted today and will be due Wednesday, February 7 C# Programming January 24 Any

More information

Arrays. Arrays: Declaration and Instantiation. Array: An Array of Simple Values

Arrays. Arrays: Declaration and Instantiation. Array: An Array of Simple Values What Are Arrays? CSC 0 Object Oriented Programming Arrays An array is a collection variable Holds multiple values instead of a single value An array can hold values of any type Both objects (reference)

More information

Chapter 12. Tool Strips, Status Strips, and Splitters

Chapter 12. Tool Strips, Status Strips, and Splitters Chapter 12 Tool Strips, Status Strips, and Splitters Tool Strips Usually called tool bars. The new ToolStrip class replaces the older ToolBar class of.net 1.1. Create easily customized, commonly employed

More information