multi user chat.doc

Upload: boopathi2k3

Post on 04-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 multi user chat.doc

    1/75

    Abstract

    The aim of this project is to design, develop and implementation a voice chatapplication using a visual basic 6.0. This application allows a multiple users to chat

    with one other through network connection.Secured chat and file transfer isencouraging new ways of working from home, collaboration and information sharing

    in many industries.

    This project describes the basic networking functions, components, and

    signaling protocols in Vo ! networks. t e"plores the ramifications of deploying Vo !

    as well as the service considerations that drive specific e#uipment and technologychoices.

    nstant messaging typically boosts communication and allows easy collaboration.

    n contrast to e$mails or phone, the parties know whether the peer is available. %n the

    other hand, people are not forced to reply immediately to incoming messages. This

    way, communication via instant messaging can be less intrusive than communication

    via phone, which is partly a reason why instant messaging is becoming more and

    more important in corporate environments. &oreover, we may do this with use of

    security, authentication and encryption technologies, depending on the re#uirements.

    n this project we can retrieve individual details of the flight which will be

    displayed in specific format. Some more types of data retrieval can also be done. 'ere

    the details can be viewed using menu option in &( form.

  • 8/14/2019 multi user chat.doc

    2/75

    INTRODUCTION

    There are several ways to e"ecute a process on other computers or other

    application domains which are related to each other through a network )*+ or

    nternet-. emote e"ecuting means running a process in another computer without

    using any resource or /! load in the local computer. sing a client1server

    application is the only solution for doing so. 2e can create and use such applications

    in a wide range of platforms and methodologies by using . 3T emoting which is

    built on the . 3T 4ramework technology. + managed object can be accessed by a

    remote client. 2hen a client makes a call to an object of the server program, a pro"y

    object grabs the call first. The pro"y object behaves like the remote object, e"cept that

    the pro"y object is running locally. emoting allows calling methods and passing

    objects across +pplication (omains.

    2e need to create our own method of cross$application communication. 2e have

    an object that needs to accept calls from client applications across 'TT!. 4irst, we5d

    need to define our object s location as a * of some kind. Then we would need to

    choose a port that the object should listen to. 2e would also need some way of

    publishing the interface of our object so that clients would know what methods are

    available to call, and we would need a method of describing the interface and

    handling the messaging between objects. The creators of the . 3T 4ramework have

    done just that and have e"posed the remoting functionality as a powerful way for

    programmers to start getting their applications to communicate.

    Server

    The remote object needs a server process where it will be instantiated. This server

    has to create a channel and put it into listening mode so that clients can connect to this

    channel.

    2hen the client connects to the remote object it needs to know the of the

    object, that is, the name of the host where the remote object is running, the protocol

    and port number to connect to, the name of the server, and the name of the remote

    object. Such a connection string can look like this7

  • 8/14/2019 multi user chat.doc

    3/75

    tcp711localhost780001SimpleServer1&y emote%bject

    The server is implemented in a console application. emoting /onfiguration

    configures the server and activate the channel. The creation of the remote object and

    communication with the client is done by the remoting infrastructure9 we just have to

    make sure that the process doesn5t end. 2e do this with /onsole

    Client

    The client specify the * of the server using tcp711hostname7port1application. n

    this e"ample, the server runs on local host with the port number 8000. The application

    name of the server is defined with the name attribute of the :application; element in

    the server configuration file.The :well$known; element specifies the remote object we want to access. The

    type attribute defines the type of the remote object and the assembly. The *

    attribute defines the path to the remote object.

    +lthough Voice over ! )Vo !- has e"isted for several years, it has only recently

    begun to take off as a viable alternative to traditional public switched telephone

    networks )!ST -. nterest in Vo ! has grown in part because the technology can help

    organi

  • 8/14/2019 multi user chat.doc

    4/75

  • 8/14/2019 multi user chat.doc

    5/75

    1.2 SYSTEM CONFIGURATION

    1.2.1 HARDWARE CONFIGURATION:

    &other board 7 ntel ABC D=

    !rocessor 7 !entium V

    +& 7 C?E &=

    'ard disk 7 A0D= )&+F- )&in B0-

    4loppy disk 7 ?.BB &=

    &onitor 7 ?C GSamsung

    Heyboard 7 ?0A keys

    &ouse 7 *ogitech

    !ort 7 E Serial

    !rinter 7 *aser )'! !rinter-

    1.2.2 SOFTWARE CONFIGURATION :

    4ront end 7 V=. 3T

    %perating System 7 2 (%2S F!

  • 8/14/2019 multi user chat.doc

    6/75

    1.2.3 SOFTWARE OVERVIEW:

    OVERVIEW OF TECHNOLOGIES USED

    3.1 Front End Technology

    !cro"o#t .NET Fr$%e&or'

    The . 3T 4ramework is a new computing platform that simplifies application

    development in the highly distributed environment of the nternet. The . 3T

    4ramework is designed to fulfill the following objectives7

    To provide a consistent object$oriented programming environment whether object

    code is stored and e"ecuted locally, e"ecuted locally but nternet$distributed, ore"ecuted remotely. To provide a code$e"ecution environment that minimi

  • 8/14/2019 multi user chat.doc

    7/75

    )D - applications to applications based on the latest innovations provided by

    +S!. 3T, such as 2eb 4orms and F&* 2eb services.

    The . 3T 4ramework can be hosted by unmanaged components that load the common

    language runtime into their processes and initiate the e"ecution of managed code,thereby creating a software environment that can e"ploit both managed and unmanaged

    features. The . 3T 4ramework not only provides several runtime hosts, but also

    supports the development of third$party runtime hosts.

    4or e"ample, +S!. 3T hosts the runtime to provide a scalable, server$side

    environment for managed code. +S!. 3T works directly with the runtime to enable

    2eb 4orms applications and F&* 2eb services, both of which are discussed later in

    this topic.nternet 3"plorer is an e"ample of an unmanaged application that hosts the runtime )in

    the form of a & &3 type e"tension-. sing nternet 3"plorer to host the runtime

    enables you to embed managed components or 2indows 4orms controls in 'T&*

    documents. 'osting the runtime in this way makes managed mobile code )similar to

    &icrosoftJ +ctiveFJ controls- possible, but with significant improvements that only

    managed code can offer, such as semi$trusted e"ecution and secure isolated file storage.

    The following illustration shows the relationship of the common language runtime andthe class library to your applications and to the overall system. The illustration also

    shows how managed code operates within a larger architecture.

    Features of the Common Language Runtime

    The common language runtime manages memory, thread e"ecution, code e"ecution,

    code safety verification, compilation, and other system services. These features are

    intrinsic to the managed code that runs on the common language runtime.

    2ith regards to security, managed components are awarded varying degrees of trust,

    depending on a number of factors that include their origin )such as the nternet,

    enterprise network, or local computer-. This means that a managed component might or

    might not be able to perform file$access operations, registry$access operations, or other

    sensitive functions, even if it is being used in the same active application.

    The runtime enforces code access security. 4or e"ample, users can trust that an

    e"ecutable embedded in a 2eb page can play an animation on screen or sing a song, butcannot access their personal data, file system, or network. The security features of the

  • 8/14/2019 multi user chat.doc

    8/75

    runtime thus enable legitimate nternet$deployed software to be e"ceptionally featuring

    rich.

    The runtime also enforces code robustness by implementing a strict type$ and code$

    verification infrastructure called the common type system )/TS-. The /TS ensures thatall managed code is self$describing. The various &icrosoft and third$party language

    compilers generate managed code that conforms to the /TS. This means that managed

    code can consume other managed types and instances, while strictly enforcing type

    fidelity and type safety.

    n addition, the managed environment of the runtime eliminates many common

    software issues. 4or e"ample, the runtime automatically handles object layout and

    manages references to objects, releasing them when they are no longer being used. Thisautomatic memory management resolves the two most common application errors,

    memory leaks and invalid memory references.

    The runtime also accelerates developer productivity. 4or e"ample, programmers can

    write applications in their development language of choice, yet take full advantage of

    the runtime, the class library, and components written in other languages by other

    developers. +ny compiler vendor who chooses to target the runtime can do so.

    *anguage compilers that target the . 3T 4ramework make the features of the . 3T4ramework available to e"isting code written in that language, greatly easing the

    migration process for e"isting applications.

    2hile the runtime is designed for the software of the future, it also supports software of

    today and yesterday. nteroperability between managed and unmanaged code enables

    developers to continue to use necessary /%& components and (**s.

    The runtime is designed to enhance performance. +lthough the common language

    runtime provides many standard runtime services, managed code is never interpreted. +

    feature called just$in$time )> T- compiling enables all managed code to run in the native

    machine language of the system on which it is e"ecuting. &eanwhile, the memory

    manager removes the possibilities of fragmented memory and increases memory

    locality$of$reference to further increase performance.

    4inally, the runtime can be hosted by high$performance, server$side applications, such

    as &icrosoftJ SK* ServerL and nternet nformation Services ) S-. This

    infrastructure enables you to use managed code to write your business logic, while still

  • 8/14/2019 multi user chat.doc

    9/75

    enjoying the superior performance of the industry5s best enterprise servers that support

    runtime hosting.

    .NET Framework Class Library

    The . 3T 4ramework class library is a collection of reusable types that tightly integratewith the common language runtime. The class library is object oriented, providing types

    from which your own managed code can derive functionality. This not only makes

    the . 3T 4ramework types easy to use, but also reduces the time associated with

    learning new features of the . 3T 4ramework. n addition, third$party components can

    integrate seamlessly with classes in the . 3T 4ramework.

    4or e"ample, the . 3T 4ramework collection classes implement a set of interfaces that

    you can use to develop your own collection classes. Iour collection classes will blendseamlessly with the classes in the . 3T 4ramework.

    +s you would e"pect from an object$oriented class library, the . 3T 4ramework types

    enable you to accomplish a range of common programming tasks, including tasks such

    as string management, data collection, database connectivity, and file access. n

    addition to these common tasks, the class library includes types that support a variety of

    speciali

  • 8/14/2019 multi user chat.doc

    10/75

    as word processors and spreadsheets, as well as custom business applications such as

    data$entry tools, reporting tools, and so on. /lient applications usually employ

    windows, menus, buttons, and other D elements, and they likely access local

    resources such as the file system and peripherals such as printers.

    +nother kind of client application is the traditional +ctiveF control )now replaced by

    the managed 2indows 4orms control- deployed over the nternet as a 2eb page. This

    application is much like other client applications7 it is e"ecuted natively, has access to

    local resources, and includes graphical elements.

    n the past, developers created such applications using /1/MM in conjunction with the

    &icrosoft 4oundation /lasses )&4/- or with a rapid application development ) +(-

    environment such as &icrosoftJ Visual =asicJ. The . 3T 4ramework incorporatesaspects of these e"isting products into a single, consistent development environment

    that drastically simplifies the development of client applications. The 2indows 4orms

    classes contained in the . 3T 4ramework are designed to be used for D

    development. Iou can easily create command windows, buttons, menus, toolbars, and

    other screen elements with the fle"ibility necessary to accommodate shifting business

    needs.

    4or e"ample, the . 3T 4ramework provides simple properties to adjust visual attributesassociated with forms. n some cases the underlying operating system does not support

    changing these attributes directly, and in these cases the . 3T 4ramework automatically

    recreates the forms. This is one of many ways in which the . 3T 4ramework integrates

    the developer interface, making coding simpler and more consistent.

    nlike +ctiveF controls, 2indows 4orms controls have semi$trusted access to a user5s

    computer. This means that binary or natively e"ecuting code can access some of the

    resources on the user5s system )such as D elements and limited file access- without being able to access or compromise other resources. =ecause of code access security,

    many applications that once needed to be installed on a user5s system can now be safely

    deployed through the 2eb. Iour applications can implement the features of a local

    application while being deployed like a 2eb page.

    !er er Application De elopment

    Server$side applications in the managed world are implemented through runtime hosts.

    nmanaged applications host the common language runtime, which allows your custom

  • 8/14/2019 multi user chat.doc

    11/75

  • 8/14/2019 multi user chat.doc

    12/75

    The . 3T 4ramework also provides a collection of classes and tools to aid in

    development and consumption of F&* 2eb services applications. F&* 2eb services

    are built on standards such as S%+! )a remote procedure$call protocol-, F&* )an

    e"tensible data format-, and 2S(* ) the 2eb Services (escription *anguage-. The

    . 3T 4ramework is built on these standards to promote interoperability with non$

    &icrosoft solutions.

    4or e"ample, the 2eb Services (escription *anguage tool included with the . 3T

    4ramework S(H can #uery an F&* 2eb service published on the 2eb, parse its

    2S(* description, and produce /N or Visual =asic source code that your application

    can use to become a client of the F&* 2eb service. The source code can create classes

    derived from classes in the class library that handle all the underlying communicationusing S%+! and F&* parsing. +lthough you can use the class library to consume

    F&* 2eb services directly, the 2eb Services (escription *anguage tool and the other

    tools contained in the S(H facilitate your development efforts with the . 3T

    4ramework.

    f you develop and publish your own F&* 2eb service, the . 3T 4ramework provides

    a set of classes that conform to all the underlying communication standards, such as

    S%+!, 2S(*, and F&*. sing those classes enables you to focus on the logic of yourservice, without concerning yourself with the communications infrastructure re#uired

    by distributed software development.

    4inally, like 2eb 4orms pages in the managed environment, your F&* 2eb service

    will run with the speed of native machine language using the scalable communication of

    S.

    A&tive Server ($%e!.NET

    +S!. 3T is a programming framework built on the common language runtime that can

    be used on a server to build powerful 2eb applications. +S!. 3T offers several

    important advantages over previous 2eb development models7

    En)$n&e" (er*'r#$n&e. +S!. 3T is compiled common language runtime code

    running on the server. nlike its interpreted predecessors, +S!. 3T can take advantage

    of early binding, just$in$time compilation, native optimi

  • 8/14/2019 multi user chat.doc

    13/75

    W'rl" Cl$!! T''l S+,,'rt. The +S!. 3T framework is complemented by a

    rich toolbo" and designer in the Visual Studio integrated development environment.

    2IS 2ID editing, drag$and$drop server controls, and automatic deployment are just a

    few of the features this powerful tool provides. ('-er $n" Fle i/ilit0. =ecause +S!. 3T is based on the common language

    runtime, the power and fle"ibility of that entire platform is available to 2eb application

    developers. The . 3T 4ramework class library, &essaging, and (ata +ccess solutions

    are all seamlessly accessible from the 2eb. +S!. 3T is also language$independent, so

    you can choose the language that best applies to your application or partition your

    application across many languages. 4urther, common language runtime interoperability

    guarantees that your e"isting investment in /%&$based development is preserved when

    migrating to +S!. 3T. Si#,li&it0. +S!. 3T makes it easy to perform common tasks, from simple form

    submission and client authentication to deployment and site configuration. 4or e"ample,

    the +S!. 3T page framework allows you to build user interfaces that cleanly separate

    application logic from presentation code and to handle events in a simple, Visual =asic

    $ like forms processing model. +dditionally, the common language runtime simplifies

    development, with managed code services such as automatic reference counting and

    garbage collection. M$n$%e$/ilit0. +S!. 3T employs a te"t$based, hierarchical configuration

    system, which simplifies applying settings to your server environment and 2eb

    applications. =ecause configuration information is stored as plain te"t, new settings

    may be applied without the aid of local administration tools. This O

  • 8/14/2019 multi user chat.doc

    14/75

    C+!t'#i $/ilit0 $n" E ten!i/ilit0. +S!. 3T delivers a well$factored

    architecture that allows developers to Oplug$inO their code at the appropriate level. n

    fact, it is possible to e"tend or replace any subcomponent of the +S!. 3T runtime with

    your own custom$written component. mplementing custom authentication or state

    services has never been easier. Se&+rit0. 2ith built in 2indows authentication and per$application configuration,

    you can be assured that your applications are secure.

    Language !upport

    The &icrosoft . 3T !latform currently offers built$in support for three languages7 /N,

    Visual =asic, and >script .

    W)$t i! AS(.NET We/ F'r#!

    The +S!. 3T 2eb 4orms page framework is a scalable common language runtime

    programming model that can be used on the server to dynamically generate 2eb pages.

    ntended as a logical evolution of +S! )+S!. 3T provides synta" compatibility with

    e"isting pages-, the +S!. 3T 2eb 4orms framework has been specifically designed to

    address a number of key deficiencies in the previous model. n particular, it provides7

    The ability to create and use reusable controls that can encapsulate common

    functionality and thus reduce the amount of code that a page developer has to write. The ability for developers to cleanly structure their page logic in an orderly

    fashion )not Ospaghetti codeO-. The ability for development tools to provide strong 2IS 2ID design support

    for pages )e"isting +S! code is opa#ue to tools-.

    +S!. 3T 2eb 4orms pages are te"t files with an .asp" file name e"tension. They can

    be deployed throughout an S virtual root directory tree. 2hen a browser client

    re#uests .asp" resources, the +S!. 3T runtime parses and compiles the target file into

    a . 3T 4ramework class. This class can then be used to dynamically process incoming

  • 8/14/2019 multi user chat.doc

    15/75

    re#uests. ) ote that the .asp" file is compiled only the first time it is accessed9 the

    compiled type instance is then reused across multiple re#uests-.

    +n +S!. 3T page can be created simply by taking an e"isting 'T&* file and

    changing its file name e"tension to .asp" )no modification of code is re#uired-. 4ore"ample, the following sample demonstrates a simple 'T&* page that collects a user5s

    name and category preference and then performs a form post back to the originating

    page when a button is clicked7

    +S!. 3T provides synta" compatibility with e"isting +S! pages. This includes support

    for :P P; code render blocks that can be intermi"ed with 'T&* content within an

    .asp" file. These code blocks e"ecute in a top$down manner at page render time.

    C'"e e)in" We/ F'r#!

    +S!. 3T supports two methods of authoring dynamic pages. The first is the method

    shown in the preceding samples, where the page code is physically declared within the

    originating .asp" file. +n alternative approach$$known as the code$behind method$$

    enables the page code to be more cleanly separated from the 'T&* content into anentirely separate file.

    Intr'"+&ti'n t' AS(.NET Server C'ntr'l!

    n addition to )or instead of- using :P P; code blocks to program dynamic content,

    +S!. 3T page developers can use +S!. 3T server controls to program 2eb pages.

    Server controls are declared within an .asp" file using custom tags or intrinsic 'T&*

    tags that contain ar+n$t45!erver5 attributes value. ntrinsic 'T&* tags are handled

    by one of the controls in theS0!te#.We/.UI.Ht#lC'ntr'l! namespace. +ny tag thatdoesn5t e"plicitly map to one of the controls is assigned the type of

    S0!te#.We/.UI.Ht#lC'ntr'l!.Ht#lGeneri&C'ntr'l .

    Server controls automatically maintain any client$entered values between round trips to

    the server. This control state is not stored on the server )it is instead stored within an

    6in,+t t0,e45)i""en57 form field that is round$tripped between re#uests-. ote also

    that no client$side script is re#uired.

  • 8/14/2019 multi user chat.doc

    16/75

    n addition to supporting standard 'T&* input controls, +S!. 3T enables developers

    to utili

  • 8/14/2019 multi user chat.doc

    17/75

    interface to create and format the report you need. The powerful eport 3ngine

    processes the formatting, grouping, and charting criteria you specify.

    Re,'rt E ,ert!

    sing the /rystal eport 3"perts, you can #uickly create reports based on your

    development needs7

    /hoose from report layout options ranging from standard reports to form letters,

    or build your own report from scratch. (isplay charts that users can drill down on to view detailed report data. /alculate summaries, subtotals, and percentages on grouped data. Show Top or =ottom results of data. /onditionally format te"t and rotate te"t objects.

    3.2 AC8 END TECHNO9OGY:

    A/'+t Mi&r'!'*t S 9 Server 2;;;

    &icrosoft SK* Server is a Structured Kuery *anguage )SK*- based, client1server

    relational database. 3ach of these terms describes a fundamental part of the architecture

    of SK* Server.D$t$/$!e

    + database is similar to a data file in that it is a storage place for data. *ike a data file, a

    database does not present information directly to a user9 the user runs an application

    that accesses data from the database and presents it to the user in an understandable

    format.

    + database typically has two components7 the files holding the physical database and

    the database management system )(=&S- software that applications use to access data.The (=&S is responsible for enforcing the database structure, including7 &aintaining the relationships between data in the database.

    3nsuring that data is stored correctly and that the rules defining data relationships

    are not violated. ecovering all data to a point of known consistency in case of system failures.

    Rel$ti'n$l D$t$/$!e

  • 8/14/2019 multi user chat.doc

    18/75

    There are different ways to organi

    To work with data in a database, you must use a set of commands and statements

    )language- defined by the (=&S software. There are several different languages that

    can be used with relational databases9 the most common is SK*. =oth the +merican

    ational Standards nstitute )+ S - and the nternational Standards %rgani

  • 8/14/2019 multi user chat.doc

    19/75

    !"L !er er Features

    &icrosoft SK* Server supports a set of features that result in the following benefits7

    Ease of installation# $eployment# an$ use

    SK* Server includes a set of administrative and development tools that improve your

    ability to install, deploy, manage, and use SK* Server across several sites.

    !calability

    The same database engine can be used across platforms ranging from laptop computers

    running &icrosoft 2indowsJ 8C18A to large, multiprocessor servers running &icrosoft

    2indows TJ, 3nterprise 3dition.

    Data warehousing

    SK* Server includes tools for e"tracting and analy

  • 8/14/2019 multi user chat.doc

    20/75

    elations are to be normalioin ormal 4orm )!> 4-7 + relation

    is in C 4 .if and only if every join dependency in is implied by the candidate key on

    . + relation can t be non$loss split into two tables but can be split into three tables.

    This is called >oin (ependency.

    Mi""le-$re Te&)n'l'%0

    A&tive D$t$ O/?e&t!.Net Overvie-

    +(%. 3T is an evolution of the +(% data access model that directly addresses user

    re#uirements for developing scalable applications. t was designed specifically for the

    web with scalability, statelessness, and F&* in mind.

    +(%. 3T uses some +(% objects, such as the /onnection and /ommand objects, and

    also introduces new objects. Hey new +(%. 3T objects include the (ataset, (ata

    eader, and (ata +dapter.

  • 8/14/2019 multi user chat.doc

    21/75

    The important distinction between this evolved stage of +(%. 3T

    and previous data architectures is that there e"ists an object $$ the (ataset $$ that is

    separate and distinct from any data stores. =ecause of that, the (ataset functions as a

    standalone entity. Iou can think of the (ataset as an always disconnected record set

    that knows nothing about the source or destination of the data it contains. nside a

    (ataset, much like in a database, there are tables, columns, relationships, constraints,

    views, and so forth.

    + (ata +dapter is the object that connects to the database to fill the (ataset. Then, it

    connects back to the database to update the data there, based on operations performed

    while the (ataset held the data. n the past, data processing has been primarily

    connection$based. ow, in an effort to make multi$tiered apps more efficient, data processing is turning to a message$based approach that revolves around chunks of

    information. +t the center of this approach is the (ata +dapter, which provides a bridge

    to retrieve and save data between a (ataset and its source data store. t accomplishes

    this by means of re#uests to the appropriate SK* commands made against the data

    store.

    The F&*$based (ataset object provides a consistent programming model that works

    with all models of data storage7 flat, relational, and hierarchical. t does this by havingno 5knowledge5 of the source of its data, and by representing the data that it holds as

    collections and data types. o matter what the source of the data within the (ataset is, it

    is manipulated through the same set of standard +! s e"posed through the (ataset and

    its subordinate objects.

    2hile the (ataset has no knowledge of the source of its data, the managed provider has

    detailed and specific information. The role of the managed provider is to connect, fill,

    and persist the (ataset to and from data stores. The %*3 (= and SK* Server . 3T(ata !roviders )System.(ata.%le(b and System.(ata.S#l/lient- that are part of the

    . et 4ramework provide four basic objects7 the /ommand, /onnection, (ata eader

    and (ata +dapter. n the remaining sections of this document, we5ll walk through each

    part of the (ataset and the %*3 (=1SK* Server . 3T (ata !roviders e"plaining what

    they are, and how to program against them. The following sections will introduce you

    to some objects that have evolved, and some that are new. These objects are7

    /onnections. 4or connection to and managing transactions against a database. /ommands. 4or issuing SK* commands against a database.

  • 8/14/2019 multi user chat.doc

    22/75

    (ata eaders. 4or reading a forward$only stream of data records from a SK*

    Server data source. (atasets. 4or storing, removing and programming against flat data, F&* data and

    relational data. (ata +dapters. 4or pushing data into a (ataset, and reconciling data against a

    database.

    2hen dealing with connections to a database, there are two different options7 SK*

    Server . 3T (ata !rovider )System.(ata.S#l/lient- and %*3 (= . 3T (ata !rovider

    )System.(ata.%le(b-. n these samples we will use the SK* Server . 3T (ata

    !rovider. These are written to talk directly to &icrosoft SK* Server. The %*3 (=

    . 3T (ata !rovider is used to talk to any %*3 (= provider )as it uses %*3 (=underneath-.

    C'nne&ti'n!

    /onnections are used to 5talk to5 databases, and are represented by provider$specific

    classes such as SK*/onnection. /ommands travel over connections and result sets are

    returned in the form of streams which can be read by a (ata eader object, or pushed

    into a (ataset object.

    C'##$n"!

    /ommands contain the information that is submitted to a database, and are represented

    by provider$specific classes such as SK*/ommand. + command can be a stored

    procedure call, an !(+T3 statement, or a statement that returns results. Iou can also

    use input and output parameters, and return values as part of your command synta". The

    e"ample below shows how to issue an S3 T statement against the orth wind

    database.D$t$ Re$"er!

    The (ata eader object is somewhat synonymous with a read$only1forward$only cursor

    over data. The (ata eader +! supports flat as well as hierarchical data. + (ata

    eader object is returned after e"ecuting a command against a database. The format of

    the returned (ata eader object is different from a record set. 4or e"ample, you might

    use the (ata eader to show the results of a search list in a web page.

    D$t$!et!

  • 8/14/2019 multi user chat.doc

    23/75

    The (ataset object is similar to the +(% ecord set object, but more powerful, and

    with one other important distinction7 the (ataset is always disconnected. The (ataset

    object represents a cache of data, with database$like structures such as tables, columns,

    relationships, and constraints. 'owever, though a (ataset can and does behave much

    like a database, it is important to remember that (ataset objects do not interact directly

    with databases, or other source data. This allows the developer to work with a

    programming model that is always consistent, regardless of where the source data

    resides. (ata coming from a database, an F&* file, from code, or user input can all be

    placed into (ataset objects. Then, as changes are made to the (ataset they can be

    tracked and verified before updating the source data. The Det /hanges method of the

    (ataset object actually creates a second (ataset that contains only the changes to the

    data. This (ataset is then used by a (ata +dapter )or other objects- to update the

    original data source. The (ataset has many F&* characteristics, including the ability to

    produce and consume F&* data and F&* schemas. F&* schemas can be used to

    describe schemas interchanged via 2eb Services. n fact, a (ataset with a schema can

    actually be compiled for type safety and statement completion.

    D$t$ A"$,ter! =O9ED

    The (ata +dapter object works as a bridge between the (ataset and the source data.sing the provider$specific S#l(ata+dapter )along with its associated S#l/ommand

    and S#l/onnection- can increase overall performance when working with a &icrosoft

    SK* Server databases. 4or other %*3 (=$supported databases, you would use the

    %le(b(ata+dapter object and its associated %le(b/ommand and %le(b/onnection

    objects. The (ata +dapter object uses commands to update the data source after

    changes have been made to the (ataset. sing the 4ill method of the (ata +dapter calls

    the S3*3/T command9 using the pdate method calls the S3 T, !(+T3 or

    (3*3T3 command for each changed row. Iou can e"plicitly set these commands in

    order to control the statements used at runtime to resolve changes, including the use of

    stored procedures. 4or ad$hoc scenarios, a /ommand =uilder object can generate these

    at run$time based upon a select statement. 'owever, this run$time generation re#uires

    an e"tra round$trip to the server in order to gather re#uired metadata, so e"plicitly

    providing the S3 T, !(+T3, and (3*3T3 commands at design time will result in

    better run$time performance.

    ?. +(%. 3T is the ne"t evolution of +(% for the . et 4ramework.

  • 8/14/2019 multi user chat.doc

    24/75

    E. +(%. 3T was created with n$Tier, statelessness and F&* in the forefront. Two

    new objects, the (ataset and (ata +dapter, are provided for these scenarios. +(%. 3T

    can be used to get data from a stream, or to store data in a cache for updates.

    Q. There is a lot more information about +(%. 3T in the documentation.

    B. emember, you can e"ecute a command directly against the database in order to

    do inserts, updates, and deletes. Iou don5t need to first put data into a (ataset in order

    to insert, update, or delete it.

    C. +lso, you can use a (ataset to bind to the data, move through the data, and

    navigate data relationships

  • 8/14/2019 multi user chat.doc

    25/75

    SYSTEM STUDY

    This deals with the study of e"isting system and its problem, evaluation of

    alternative solutions and the proposed system definition.

    E i!tin% !0!te#The scenario in most organiava. t s does not a graphical

    +s the number of passenger and items are increasing the number of register also

    with increase

    (RO(OSED SYSTEM

    t overcome the problem e"isting project, and support a more features.

    FEATURES

    Support clear voice transmission sed lossy less file compression techni#ue

    sed smiles

  • 8/14/2019 multi user chat.doc

    26/75

    /onnect multi client in *+ (oes not need separate protocol

    Support special privileged user

    3ach person must have login and register the Server t s developed using V= 6.0. its supported more smiles and graphical interface

  • 8/14/2019 multi user chat.doc

    27/75

    SYSTEM DESIGN

    The System design is last phase that indicate the final system and process of

    the final system. n the design phase of the data base tables, input screen design. +nd

    output designs were designed. The database tables were designed by using all the

    necessary fields in a compact manner. The redundancy and duplication of fields are

    avoided. +ll the input screens in this system are user friendly and understandable

    format also the si

  • 8/14/2019 multi user chat.doc

    28/75

    nput validation is being done at program level to check errors and help

    message are to be provided to effectively enter data into the data entry screen in the

    software.

    +s human is prone for errors and mistakes confirmation for critical data

    entries are being provided.

    3.2 OUT(UT DESIGN

    The entire output screens are informative and interactive in such a way that the

    user can fulfill his re#uirements through #ueries. n this the system the main output

    screens are to up$to$date reports and listing of re#uired information.

    System design is process of planning of a new system that is a complement of

    the old and to replace the e"isting system with new system. The new design is a

    solution and the translation of the re#uirements of the old by the ways of meeting

    them.

    The various inputs, the objectives and the output re#uirements of the system

    were identified. +fter performing the necessary modification, the input1output reports

    were finali

  • 8/14/2019 multi user chat.doc

    29/75

    processing, data entry, and the activity of putting the data into the computer for

    processing.

    (ata entry can be achieved by instructing the computer for processing and to

    read the data from a written or printed documents, or it can occur by having people

    keying data directly into the system.

    naccurate input data are the most common causes of error in data processing.

    !roper message and appropriate direction to control errors committed by data entry

    operations. The following features have been incorporated into the code design of the

    proposed system.

    Men+ "riven

    This system is menu driven. This simplifies computer data access or entry.

    nstead of remembering what to enter, the user chooses from a menu. The menu

    limits the user choice of response, but reduces the chances for error in data entry.

    E$!0 "$t$ in,+t

    (ata entry code has been designed in a manner, which is much similar, the

    source documents. +ppropriate messages are provided which prompts the user in

    entering the right data erroneous data puts are checked at the end of each code entry.

    D$t$ v$li"$ti'n

    nput data is validated to minimi

  • 8/14/2019 multi user chat.doc

    30/75

    Inter$&tive "i$l'%+e!:

    The system engages the user in an interactive dialogue. The system is able to

    e"tract missing or omitted information from the user by directing the user through

    appropriate messages.

    3.@ DATA ASE DESIGN

    + database is a collection of interrelated data with minimum redundancy to serve

    #uick and effective. n oracle, data are stored in tables. 3ach record is stored in single

    rows of the tables. 3ach column of the tables refers to the particular fields on the table

    proper care is to design the database to achieve the objectives below. (ata integration. (ata consistency

    (ata independence. To the printer.

    To the server.

  • 8/14/2019 multi user chat.doc

    31/75

    TESTING AND IM(9EMENTATION

    Te!tin%

    Software testing is a critical element of software #uality assurance and

    represents the ultimate review of specification, design and code. Testing a program

    consists of providing the program with the set of test inputs or test cases and

    observing if the program behaves as e"pected. t is vital to the success of the system.

    Testing analy

  • 8/14/2019 multi user chat.doc

    32/75

    may begin. Software validation is achieved through series of black bo" test that

    demonstrate conformity with re#uirements. The application was made free of all

    logical and interface errors, validation testing was done by inputting dummy data to

    ensure that the software developed satisfied all the re#uirements of the user.'utput testing

    +fter performing the validation testing, the ne"t step is output testing of the

    proposed system, since no system could be useful if it does not produce the re#uired

    output in the specific format. The checking them with all possible test values tests the

    output generated by the system under consideration. 'ence output testing does not

    result any correction to the system.

    @.2. SYSTEM IM(9EMENTATION:

    mplementation includes all those activities that take place to convert from the

    old system to the new. The old system consists of manually operating delivery

    information system, which is operated in a very different manner from the proposed

    new system. The new, replacing the e"isting manual system. + proper implementation

    is essential to provide a reliable system you meet the re#uirements of the operating

    organi

  • 8/14/2019 multi user chat.doc

    33/75

    The implementation plan includes a description of all the activities that must

    occur to implement the new airline information system to put into operation.

    The implementation plan should anticipate possible problems and must be able

    to deal with them. The usual problems may be missing documents, mi"ed data

    formats between current files, errors in data translation, missing data etc.

  • 8/14/2019 multi user chat.doc

    34/75

    C'NCL%!('N

    The project was successful, and the goals globally reached, we could build an

    intuitive chat, which allows public, private, secured discussions. The application is

    robust, and designed to answer to many e"ception cases. The code is relatively clear

    and allows easily eventual other programmers to enter into it to design new

    developments. +lthough packet loss of any kind is undesirable, some voice packet

    loss can be tolerated as long as the loss is spread out over a large amount of users.

    Voice #uality is not generally affected if the amount of packet loss is less than five

    percent for the total number of calls.

    &enu driven with user friendly screen enables the user to use the system

    without any difficulty is in convenient. (ue to many options the user need not type

    more, instead he can select values from the combo bo" or such tools are provided.

    This shows the user friendliness of the system also users are guided with valuable

    information, errors message etc, and no formal knowledge is needed for the user to

    use the system.

  • 8/14/2019 multi user chat.doc

    35/75

    )()L('*RA+,-

    ?. 3lias m +ward, System +nalysis and (esign, Dolgotia publications pvt.ltd.,

    ?888.

    E. 'enry f korth, (atabase System concepts +braham Silverschtatason beres,Visual =asic !rogramming =ible, et al

    B. Steven oman, on !etrusha V= *anguage in a utshell , %5 eilly, E00?

    C. /ameron 2akefield, 'enk$3vert Sonder, V= (eveloper s Duide, 2ei &eng

    *ee Series 3ditor

  • 8/14/2019 multi user chat.doc

    36/75

    A((ENDICES

    D$t$*l'- Di$%r$#

  • 8/14/2019 multi user chat.doc

    37/75

  • 8/14/2019 multi user chat.doc

    38/75

    S'+r&e C'"e

    SERVER

    %ption 3"plicit!rivate (eclare Sub nit/ommon/ontrols *ib OcomctlQE.dllO )-

    N f 4alse Then 5Trick preserves /ase of 3nums when typing in (3!rivate aw(ata%utgoing, aw(ata ncoming, Server3vent, Server3rror N3nd f !rivate Type T ser sername +s String 5 =enut

  • 8/14/2019 multi user chat.doc

    39/75

    /ase Server3vent lstServer3vents.+dd tem OYServer O Time OZ O 3ntry /ase infodata lstServer3vents.+dd tem OY nformation O Time OZ O 3ntry /ase Server3rror lstServer3vents.+dd tem OY43'*3 O Time OZ O 3ntry 3nd Select lstServer3vents.Selected)lstServer3vents.*ist/ount $ ?- True

    3nd Sub

    !rivate 4unction =ytesToString)=ytes +s *ong- +s String

    (im

  • 8/14/2019 multi user chat.doc

    40/75

    lv ser.*ist tems)i M ?-.Sub tems)Q- +ll ser)i-.banTime lv ser.*ist tems)i M ?-.Sub tems)B- +ll ser)i-.wsc ( lv ser.*ist tems)i M ?-.Sub tems)C- +ll ser)i-.Voice3nabled lv ser.*ist tems)i M ?-.Sub tems)6- +ll ser)i-.Voice!layer ( e"t i

    3nd Sub

    !rivate Sub cmd+dd serX/lick)-

    (im ew sername +s String(im ew!assword +s String(im ew+dmin +s String(im /rcQE/heck +s ew cls/ /(im fnr +s nteger (im

  • 8/14/2019 multi user chat.doc

    41/75

    ew+dmin OfalseO 3nd f lv+dd em.*ist tems. tem)e-.Sub tems)?- /rcQE/heck./alculateString) ew!assword ew sername- lv+dd em.*ist tems. tem)e-.Sub tems)E- ew+dmin (o3vents efresh (o3vents 5\ so alles hin

  • 8/14/2019 multi user chat.doc

    42/75

    tmrStatsXTimer 4or i 0 To =ound3")+ll ser- lv+dd em.*ist tems.+dd , , +ll ser)i-. sername lv+dd em.*ist tems. tem)i M ?-.Sub tems)?- +ll ser)i-. ser!ass lv+dd em.*ist tems. tem)i M ?-.Sub tems)E- f)+ll ser)i-.+dmin, OtrueO, OfalseO- e"t i3nd Sub

    !rivate Sub 4ormXKuery nload)/ancel +s nteger, X nload&ode +s nteger-

    f ot 3"itServer +nd ot vb+pp2indows Then /ancel True &e.'ide 3nd f 3nd Sub

    !rivate Sub 4ormX nload)/ancel +s nteger-(im i +s nteger (im fnr +s nteger %n 3rror esume e"t modSysTray. emTray wsc&ain./lose 4or i ? To 2insock/ount wsc)2insock/ount-./lose nload wsc)2insock/ount- (o3vents e"t i +dd*og3ntry O2insocks beendetO, infodata /leanup +dd*og3ntry O(irectF A Voice Server geschlossenO, infodata %n 3rror esume e"t &k(ir +pp.!ath O]Server*ogsO %n 3rror DoTo 0 fnr 4ree4ile %pen +pp.!ath O]Server*ogs]Server*ogXO Det ow O.t"tO 4or %utput +s Nfnr 4or i 0 To lstServer3vents.*ist/ount $ ? !rint Nfnr, lstServer3vents.*ist)i- (o3vents e"t i +dd*og3ntry OSchlie e Server$*ogO, infodata !rint Nfnr, OYServer O Time OZ O OSchlie e Server$*ogO /lose Nfnr (oSleep E003nd Sub

    %ption 3"plicit!ublic Type %T 4I /% (+T+ cbSi

  • 8/14/2019 multi user chat.doc

    43/75

  • 8/14/2019 multi user chat.doc

    44/75

    !ublic Sub =aloonTip)!ic +s !icture=o", X traytip +s String, X !ict +s !icture=o", X nfoTip +s String, X nfoTitle +s String- 2ith nfX con(ata .cbSi

  • 8/14/2019 multi user chat.doc

    45/75

    Client5 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$55 V=&essenger8 Server /lient55 )/- by Thorben *inneweber )E00C-55 %penSource55 &ay be passed unchanged.5/an be changed only for private use.5/ommercial use is forbidden^55Suggestions for improvements and changes, please

    55 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

    5 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$55 V=&essenger 8 /lient55 Serverbefehle5 $$$$$$$$$$$$$$$$$$$$$555 *ogin5Y sernameZ YpasswordZ5$; *ogin e#uest55&essage5Y&essageZ5$; Y&essageZ to all55!rivate&essage5Y sernameZ5$; &essage to YusernameZ55 udge5Y sernameZ5$; udge to YusernameZ554ile5Y sernameZ Y4ilenameZ Y4ile Si

  • 8/14/2019 multi user chat.doc

    46/75

    555Hick 5Y sernameZ5$; Hick YusernameZ )only works if the sender has no admin rights-55=an5Y sernameZ5$; =anned YusernameZ )only works if the sender has no admin rights-55&ake+dmin5Y sernameZ5$; &ake Y ser nameZ to the +dmin )only works if the sender has no admin rights-55Diveupadmin5YZ5$; Dives the +dmin

    55Hick voice5Y sernameZ5$; Throws YusernameZ from the Voice /hat55*ogin admin5YZ5$; epresents the fi"ed admin rights restored55+skvoice5YZ5$; e#uest for voice chat555 eturn values from the server )3vents- )from the perspective of the client-5$$$$$$$$$$$$$$$$$$$$$$$$55*ogin5Y+cceptString )accept ] deny-Z5$; *ogin e#uest$ esponse55&essage5Y sernameZ YmessageZ Y+dmin )true ] false-Z5$; Y&essageZ to all of YusernameZ55!rivate&essage5Y sernameZ YmessageZ Y+dmin )true ] false-Z5$; !rivate YnewsZ from YusernameZ55!rivatemessageb5Y sernameZ YmessageZ Y+dmin )true ] false-Z5$; /onfirmation by a private YmessageZ55 udge5Y sernameZ Y+dmin )true ] false-Z5$; udge from YusernameZ55 udgeb

  • 8/14/2019 multi user chat.doc

    47/75

    5Y sernameZ Y+dmin )true ] false-Z5$; udge Send confirmation554ileb5Y sernameZ YfilenameZ Y4ilesi

  • 8/14/2019 multi user chat.doc

    48/75

  • 8/14/2019 multi user chat.doc

    49/75

    +ddTe"tTo T= OSie haben den (ateintransfer mit O sername O abgelehntO,3vent/olor, True, True 3lse f +cceptStr OalreadyreceivingO Then 5 %T +//3!TST ... +ddTe"tTo T= O3in (ateitransfer wurde automatisch abgelehnt, da Sie bereits eine(atei empfangenO, 3vent/olor, True, True 3nd f 4lash+ndSound

    3nd Sub

    !rivate Sub +dd&essageTe"tTo T=) sername +s String, X &essage +s String, X !rivate&essage +s =oolean, X +dmin +s =oolean-

    5\ This wonderful feature added5$ ews

    5$ !rivate messages

    &essage mod T=Smilies./heck ichTe"t4orSmilies)&essage- 5 Smilie$/odes replace +ddTe"tTo T= sername f)+dmin, O )+dministrator-O, OO- f)!rivate&essage, O)private achricht-O, OO- O sagt7O, CCE66?E, , !rivate&essage +ddTe"tTo T= &essage, , , !rivate&essage

    3nd Sub

    !rivate Sub +ddTe"tTo T=)Te"t +s String, X %ptional /olor +s /olor/onstants vb=lack, X %ptional =old +s =oolean 4alse, X %ptional talic +s =oolean 4alse-

    5\ Simplify the O T=$te"t +ddensO

    2ith T=/hat .SelStart *en).Te"t- .Sel=old =old .Sel/olor /olor .Sel talic talic .SelTe"t Te"t vb ew*ine 3nd 2ith 5 T=/hat

    3nd Sub

    !rivate Sub +skVoice)+llow +s String-

    5The server has accepted our re#uest to be allowed to engage in voice chat5$]"Qe ow we can connect to the (FA voice server record )otherwise we would5/an not connect to the Voice Server-

    f ot b*oadedfrmVoice Then f +llow OtrueO Then +ddTe"tTo T= OThe server has the re#uest for a Voice/hat approvedO, 3vent/olor,True, True

  • 8/14/2019 multi user chat.doc

    50/75

    frmVoice.*eft frm&ain.*eft M frm&ain.2idth frmVoice.Top frm&ain.Top frmVoice.Show vb&odeless 3lse 5 %T +**%2... +ddTe"tTo T= OThe server has rejected the re#uest for a voice chatO, 3vent/olor,True, True 3nd f 3nd f

    3nd Sub

    !rivate Sub =an)+dmin ame +s String, X sername +s String-

    +ddTe"tTo T= +dmin ame O has O sername O banned^O, 3vent/olor, True, True

    3nd Sub

    !rivate Sub cmd4ormat/odeX/lick)-%n 3rror esume e"t

    T=&essage.Te"t T4 modV=to T4/ode./reate/oloredString) T=&essage.Te"t-

    3nd Sub

    !rivate Sub cmd udgeX/lick)-

    (im To ser +s String

    To ser lst=uddys.*ist tems)lst=uddys.Selected tem- 5\ Sends a nudge to selected user f *en=)To ser- 0 Then 3"it Sub f To ser mod(eclaration. sername Then &sg=o" OIou can not 5 udge5 send to yourselfO, vb nformation 3lse 5 %T Tousen... Send(ata OnudgeWO lst=uddys.*ist tems)lst=uddys.Selected tem- 3nd f

    3nd Sub

    !rivate Sub cmd!rivate&essageX/lick)-

    (im &essageToSend +s String(im To ser +s String

    &essageToSend mod4ast eplace. eplace) T=&essage.Te"t T4, OWO, OO- To ser lst=uddys.*ist tems)lst=uddys.Selected tem- 5\ Send a private message that only the other )and one can myself- see f *en=)mod4ast eplace. eplace) T=&essage.Te"t T4, OWO, OO-- 0 Then T=&essage.Te"t vb ullString 3"it Sub 3nd f f *en=)To ser- 0 Then 3"it Sub f *en)&essageToSend- ; )E0BA00- Then &sg=o" OThe message must not e"ceed E00kb in si

  • 8/14/2019 multi user chat.doc

    51/75

    f ot To ser mod(eclaration. sername Then Send(ata OprivatemessageWO lst=uddys.*ist tems)lst=uddys.Selected tem- OWO &essageToSend T=&essage.Te"t vb ullString %n 3rror esume e"t T=&essage.Set4ocus %n 3rror DoTo 0 3lse 5 %T %T... &sg=o" OIou can not send private messages to yourself^O, vb nformation 3nd f 3nd f

    3nd Sub

    !rivate Sub cmdSendX/lick)-

    (im &essageToSend +s String

    &essageToSend mod4ast eplace. eplace) T=&essage.Te"t T4, OWO, OO- 5\ Sends a message to all f ot *en=)mod4ast eplace. eplace) T=&essage.Te"t, OWO, OO-- 0 Then tmrType.3nabled 4alse f *en)&essageToSend- ; )E0BA00- Then &sg=o" O(ie achricht darf ma"imal E00kb gro sein^O 3lse 5 %T *3 ) T=&3SS+D3.T3FT T4 -...5 %T *3 )&3SS+D3T%S3 (- ... Send(ata OtypingWfalseO f T=&essage.Te"t O]]kickO Then Send(ata OkickWO lst=uddys.*ist tems)lst=uddys.Selected tem- 3lse f T=&essage.Te"t O]]banO Then 5 %T T=&3SS+D3.T3FT... Send(ata ObanWO lst=uddys.*ist tems)lst=uddys.Selected tem- 3lse f T=&essage.Te"t O]]makeadminO Then 5 %T T=&3SS+D3.T3FT... Send(ata OmakeadminWO lst=uddys.*ist tems)lst=uddys.Selected tem- 3lse f T=&essage.Te"t O]]giveupadminO Then 5 %T T=&3SS+D3.T3FT... Send(ata OgiveupadminO 3lse f T=&essage.Te"t O]]loginadminO Then 5 %T T=&3SS+D3.T3FT... Send(ata OloginadminWO mod(eclaration. sername 3lse f T=&essage.Te"t O]]kickvoiceO Then 5 %T T=&3SS+D3.T3FT... Send(ata OkickvoiceWO lst=uddys.*ist tems)lst=uddys.Selected tem- 3lse 5 %T T=&3SS+D3.T3FT... Send(ata OmessageWO &essageToSend 3nd f T=&essage.Te"t vb ullString %n 3rror esume e"t T=&essage.Set4ocus %n 3rror DoTo 0 3nd f 3lse 5 %T %T... T=&essage.Te"t vb ullString 3nd f

    3nd Sub

    !rivate Sub cmdSend4ileX/lick)-

    (im To ser +s String

  • 8/14/2019 multi user chat.doc

    52/75

    (im 4ilename +s String

    To ser lst=uddys.*ist tems)lst=uddys.Selected tem- f *en=)To ser- 0 Then 3"it Sub f mod(eclaration.Sending%r eceiving4ile Then &sg=o" OSie senden oder empfangen bereits eine (atei.O 3lse 5&%((3/*+ +T % .S3 ( D% 3/3 V D4 *3 4+*S310 f ot To ser mod(eclaration. sername Then mod(eclaration.Sending%r eceiving4ile True mod//.Show%pen hwnd, True 4ilename mod//.4ile(ialog.s4ile 4ilename *eft )4ilename, nStr)4ilename, vb ull/har- $ ?- 5chr)0- cut mod(eclaration.!ath%f4ileToSend%r eceive 4ilename f ot 4ile3"ists)4ilename- Then mod(eclaration.Sending%r eceiving4ile 4alse &sg=o" OThe soecified file does not e"ist^O, vb nformation 3lse 5 %T %T...

    mod(eclaration. eceiver%rSender To ser Send(ata OfileWO To ser OWO mod4unctions.3"tract4ilename)4ilename- OWO mod4unctions.Det4ile*en)4ilename-

    3nd f 3lse 5 %T %T... &sg=o" OIou can not send files to yourself^O, vb nformation 3nd f 3nd f

    3nd Sub

    !rivate Sub /onnected)-

    5 \ Should be called when connection has been established ]"E6 *ogin

    modSysTray.&odifyTray picTray, O&essenger 8 $ %nlineO, picTray T=&essage.3nabled True cmdSend.3nabled True cmd udge.3nabled True cmdSend4ile.3nabled True cmd!rivate&essage.3nabled True %n 3rror esume e"t T=&essage.Set4ocus %n 3rror DoTo 0 (o3vents

    3nd Sub

    !rivate Sub (isconnected)-

    5\ Should be called when there is no Vebindung )also in the 4ormX*oad^-]"Qe $ 3verything isdisabled 1 reset

    wsc./lose modSysTray.&odifyTray picTray, O&essenger 8 $ not connectedO, picTray tmr/onnect.3nabled 4alse tmr/onnection/heck.3nabled 4alse tmr*ogin.3nabled 4alse

  • 8/14/2019 multi user chat.doc

    53/75

    Time%ut/ 0 lst=uddys./lear T=&essage.3nabled 4alse cmdSend.3nabled 4alse cmd udge.3nabled 4alse cmdSend4ile.3nabled 4alse cmd!rivate&essage.3nabled 4alse f b*oadedfrmTransfer Then frmTransfer. nloadfrmTransfer mod(eclaration.Sending%r eceiving4ile 4alse (o3vents

    3nd Sub

    !rivate Sub 4ile) sername +s String, X 4ilename +s String, X 4ileSi

  • 8/14/2019 multi user chat.doc

    54/75

    +dmin +s String-

    5 \ + confirmation that you have sent a re#uest

    +ddTe"tTo T= O(o you have a #uestion to the user O sername O sent, the file 5O 4ilename O5 )O 4ileSi

  • 8/14/2019 multi user chat.doc

    55/75

    4ile= /Str)v)?--, /Str)v)E--, /Str)v)Q--, /Str)v)B-- 5\ 4ileTransfer=3ST T D D empfangen 1 Sende=est tigung der4ileTransfer=3ST T D D /ase OacceptfileO 5 $; confirmation that you accept 1 not accept +ccept4ile /Str)v)?--, /Str)v)E--, /Str)v)Q--, /Str)v)B-- /ase OacceptfilebO 5 $; you get ne in#uiry +ccept4ile= /Str)v)?--, /Str)v)E--, /Str)v)Q-- /ase OtypingO serTyping /Str)v)?--, /Str)v)E--, /Str)v)Q-- /ase OvoiceO Voice /Str)v)?--, /Str)v)E--, /Str)v)Q-- /ase OaskvoiceO +skVoice /Str)v)?--

    5 5 5 \ The admin has done something

    /ase OkickO Hick /Str)v)?--, /Str)v)E-- /ase ObanO =an /Str)v)?--, /Str)v)E-- /ase OmakeadminO &ake+dmin /Str)v)?--, /Str)v)E-- /ase OgiveupadminO Dive p+dmin /Str)v)?-- /ase OloginadminO *ogin+dmin /Str)v)?-- /ase OkickvoiceO HickVoice /Str)v)?--, /Str)v)E-- 3nd Select 3nd f 5 f ot 'as+ctive2indow Then 5 mod4unctions.4lash4orm frm&ain.hwnd, 4alse 5\ it what happened, then flash form 5 3nd f

    3nd Sub

    !rivate Sub 4ormX nitiali

  • 8/14/2019 multi user chat.doc

    56/75

    3nd 2ith 5 T=&3SS+D3 4ill ntelliSense2ith+dmin ights nitSmilies %n 3rror esume e"t f mod(eclaration.Saved%ptions.Save'istory Then T=/hat.*oad4ile +pp!ath O]history]O Det(ate O.rtfO T=/hat.SelStart *en) T=/hat.Te"t- 3nd f %n 3rror DoTo 0 f ot s (3 Then /all o&agnetic2nd.+dd2indow)&e.hwnd- 3nable *(etect T=/hat.hwnd, &e.hwnd mod esi

  • 8/14/2019 multi user chat.doc

    57/75

    !rivate Sub 4ormX nload)/ancel +s nteger-

    (im 4rm +s 4orm

    f mod(eclaration.b*oadedfrmTransfer Then frmTransfer.tmr3nd.3nabled True 3nd f f mod(eclaration.b*oadedfrmVoice Then nload frmVoice 3nd f 4or 3ach 4rm n V=.4orms 4rm.'ide e"t 4rm (o3vents 4or 3ach 4rm n V=.4orms nload 4rm

    Set 4rm othing e"t 4rm mod4unctionsE.Save%ptions modSysTray. emTray mod T='ighlight.(isable *(etect mod esi

  • 8/14/2019 multi user chat.doc

    58/75

    Shift +s nteger, X F +s Single, X I +s Single-

    (im +s nteger

    4or 0 To imgSmilie./ount $ ? imgSmilie) -.=orderStyle f)) nde"-, ?, 0- e"t

    3nd Sub

    !rivate Sub is=utton?X/lick)-

    picSmilies/ontainer.Visible 4alse

    3nd Sub

    !rivate Sub Hick)+dmin ame +s String, X sername +s String-

    +ddTe"tTo T= +dmin ame O hat O sername O gekicked^O, 3vent/olor, True,True

    3nd Sub

    !rivate Sub HickVoice)+dmin ame +s String, X sername +s String-

    +ddTe"tTo T= +dmin ame O has O sername O from Voice/hat gekicked^O,3vent/olor, True, True

    3nd Sub

    !rivate Sub *ogin)*oginString +s String-

    5 \ 'ere, the server sends back whether he has accepted sername 1 !assword

    f *oginString OacceptO Then tmr*ogin.3nabled 4alse Status=ar.SimpleTe"t OThe server accepts the login re#uest...O 5 so ... sign$up process successfully $ from here is testing whether you are online tmr/onnection/heck.3nabled True /onnected 3lse 5 %T *%D ST D... f *oginString OdenyO Then Status=ar.SimpleTe"t OThe server did not accept the login re#uest... 2rong!asswordUO (isconnected Sign n 3nd f 3nd f

    3nd Sub

  • 8/14/2019 multi user chat.doc

    59/75

    !rivate Sub *ogin+dmin) sername +s String-

    +ddTe"tTo T= sername O hat seine +dministrator$!rivilegien wiedererlangt^O,3vent/olor, True, True

    3nd Sub

    !rivate Sub lst=uddysX4ile(rag(rop)4ilename +s String-

    (im To ser +s String

    To ser lst=uddys.*ist tems)lst=uddys.Selected tem- f *en=)To ser- 0 Then 3"it Sub f mod(eclaration.Sending%r eceiving4ile Then &sg=o" OSend or receive a file already.O 3lse 5&%((3/*+ +T % .S3 ( D% 3/3 V D4 *3 4+*S310 f ot To ser mod(eclaration. sername Then

    mod(eclaration.Sending%r eceiving4ile True mod(eclaration.!ath%f4ileToSend%r eceive 4ilename f ot 4ile3"ists)4ilename- Then mod(eclaration.Sending%r eceiving4ile 4alse &sg=o" OThe soecified file does not e"ist^O, vb nformation 3lse 5 %T %T... mod(eclaration. eceiver%rSender To ser Send(ata OfileWO To ser OWO mod4unctions.3"tract4ilename)4ilename- OWO

    mod4unctions.Det4ile*en)4ilename- 3nd f 3lse 5 %T %T... &sg=o" OIou can not send files to yourself^O, vb nformation 3nd f 3nd f

    3nd Sub

    !rivate Sub lst ntelliSenseX(bl/lick)-

    T=&essage.Te"t O]]O lst ntelliSense.Te"t T=&essage.SelStart *en) T=&essage.Te"t- lst ntelliSense.Visible 4alse ntelliVisible 4alse T=&essage.Set4ocus

    3nd Sub

    !rivate Sub &ake+dmin)+dmin ame +s String, X sername +s String-

    +ddTe"tTo T= +dmin ame O has O sername O +dministrator privilegesgranted^O, 3vent/olor, True, True

    3nd Sub

    !rivate Sub &essage) sername +s String, X &essage +s String, X +dmin +s String-

  • 8/14/2019 multi user chat.doc

    60/75

    5 \ one very normal message arrives5

    +dd&essageTe"tTo T= sername, &essage, 4alse, )+dmin OtrueO- 4lash+ndSound

    3nd Sub

    !rivate Sub mnu+boutX/lick)-

    %n 3rror esume e"t picSmilies/ontainer.Visible 4alse frm+bout.Show

    3nd Sub

    !rivate Sub mnu+udio+X/lick)-

    un+udio+ssistant &e.hwnd

    3nd Sub

    !rivate Sub mnu/lose&essengerX/lick)-

    nload &e

    3nd Sub

    !rivate Sub mnu4ileTransferX/lick)-

    cmdSend4ileX/lick

    3nd Sub

    !rivate Sub mnu4ontX/lick)-

    (im s4ont +s Selected4ont(im a4ont +s 4% TX/% ST

    %n 3rror DoTo eXTrap 4ont(ialog.i!ointSi

  • 8/14/2019 multi user chat.doc

    61/75

    .Sel talic s4ont.b talic .Sel nderline s4ont.b nderline .SelStrikeThru s4ont.bStrike%ut 3nd 2ith 5 T=&3SS+D3 5 the same in the struct speciher !rofile 2ith mod(eclaration.Saved%ptions.4ont .4ont=old T=&essage.Sel=old 5.4ont/olor T=&essage.Sel/olor .4ont talic T=&essage.Sel talic .4ont ame T=&essage.Sel4ont ame .4ontSi

  • 8/14/2019 multi user chat.doc

    62/75

    3nd Sub

    !rivate Sub mnu udgeX/lick)-

    cmd udgeX/lick

    3nd Sub

    !rivate Sub mnu%ptionsX/lick)-

    picSmilies/ontainer.Visible 4alse

    3nd Sub

    !rivate Sub mnu%ther serX/lick)-

    picSmilies/ontainer.Visible 4alse

    3nd Sub

    !rivate Sub mnuprivate&essageX/lick)-

    cmd!rivate&essageX/lick

    3nd Sub

    !rivate Sub mnuSend&essageX/lick)-

    cmdSendX/lick

    3nd Sub

    !rivate Sub mnuSmiliesX/lick)-

    (im +s nteger

    %n 3rror esume e"t picSmilies/ontainer.Visible ot picSmilies/ontainer.Visible 4or 0 To imgSmilie./ount $ ? imgSmilie) -.=orderStyle 0 e"t picSmilies/ontainer.Set4ocus

    3nd Sub

    !rivate Sub mnuV=&essengerX/lick)-

    picSmilies/ontainer.Visible 4alse

    3nd Sub

    !rivate Sub mnuVoice/hatX/lick)-

    picSmilies/ontainer.Visible 4alse f ot b*oadedfrmVoice Then

  • 8/14/2019 multi user chat.doc

    63/75

    Send(ata OaskvoiceO 3nd f

    3nd Sub

    !rivate Sub udge) sername +s String, X +dmin +s String-

    5 \ udge one arrives

    +ddTe"tTo T= sername f)+dmin OtrueO, O )+dministrator-O, OO- O them has a5 udge5 gesendetO, 3vent/olor, True, True !laySound udgeSend%r eceived mod4unctions.Shake4orm frm&ain, C, ?000

    3nd Sub

    !rivate Sub udge=) sername +s String, X +dmin +s String-

    5 \ confirmation that it has sent a nudge to jmd so that we ourselves also5 to suffer a bit, we also raised the nudge

    !laySound udgeSend%r eceived +ddTe"tTo T= OSie haben einen 5 udge5 an O sername O gesendetO, 3vent/olor,True, True mod4unctions.Shake4orm frm&ain, C, ?000

    3nd Sub

    !rivate Sub picSmilies/ontainerX*ost4ocus)-

    picSmilies/ontainer.Visible 4alse

    3nd Sub

    !rivate Sub picTrayX&ouse&ove)=utton +s nteger, X Shift +s nteger, X F +s Single, X I +s Single-

    Static lng&sg +s *ong

    lng&sg F 1 Screen.Twips!er!i"elF Select /ase lng&sg /ase 2&X*= TT% (=*/*H %n 3rror esume e"t frm&ain.2indowState vb ormal frm&ain.Show %n 3rror DoTo 0 3nd Select

    3nd Sub

  • 8/14/2019 multi user chat.doc

    64/75

    !rivate Sub !rivate&essage) sername +s String, X &essage +s String, X +dmin +s String-

    5 \ a private message to come

    +dd&essageTe"tTo T= sername, &essage, True, )+dmin OtrueO- 4lash+ndSound

    3nd Sub

    !rivate Sub !rivate&essage=) sername +s String, X &essage +s String, X +dmin +s String-

    5 \ /onfirmation that one has received a private message

    +dd&essageTe"tTo T= mod(eclaration. sername, &essage, True, )+dmin OtrueO- 5+ddTe"tTo T= OYO mod(eclaration. sername OZYSie haben eine private &essage O sername O sentZ O &essage, , )+dmin OtrueO-, True

    4lash+ndSound

    3nd Sub

    !rivate Sub T=/hatX/hange)-

    mod4unctions. efresh T= T=/hat

    3nd Sub

    !rivate Sub rtbmessageX/hange)-

    cmdSend.3nabled ot *en=) T=&essage.Te"t- 0 f *en=) T=&essage.Te"t- 0 Then 2ith T=&essage .Sel4ont ame mod(eclaration.Saved%ptions.4ont.4ont ame .Sel4ontSi

  • 8/14/2019 multi user chat.doc

    65/75

    f Hey/ode QE Then Hey/ode 0 3nd f

    3nd Sub

    !rivate Sub T=&essageXHey!ress)Hey+scii +s nteger-

    f Hey+scii ?Q Then cmdSendX/lick Hey+scii 0 3"it Sub 3nd f f ot tmrType.3nabled Then Send(ata OtypingWtrueO 3nd f tmrType.3nabled 4alse tmrType.3nabled True

    3nd Sub

    !rivate Sub T=&essageXHey p)Hey/ode +s nteger, X Shift +s nteger-

    (im Te"t3ntered +s String(im 4ound +s nteger (im +s nteger

    f *en) T=&essage.Te"t- ; E Then Te"t3ntered &id ) T=&essage.Te"t, Q, *en) T=&essage.Te"t-- 3nd f f *eft ) T=&essage.Te"t, E- O]]O Then ntelliVisible True 5 general map )]] ]] at the start- 4ound $? 4or 0 To lst ntelliSense.*ist/ount $ ? f *eft )lst ntelliSense.*ist) -, *en)Te"t3ntered-- Te"t3ntered Then f ot *en)lst ntelliSense.*ist) -- *en)Te"t3ntered- Then 4ound 3nd f 3"it 4or 3nd f e"t f 4ound $? Then ntelliVisible 4alse 5 wenns can not be found in the bo", then no 3lse 5 %T 4% (... lst ntelliSense.Selected)4ound- True 3nd f 3lse 5 %T *34T ) T=&3SS+D3.T3FT,... ntelliVisible 4alse 3nd f f ntelliVisible Then lst ntelliSense.Top T=&essage.Top M mod4unctions.DetT/ursI M E lst ntelliSense.*eft T=&essage.*eft M mod4unctions.DetT/ursF M B lst ntelliSense.Visible True 3lse 5 T3** V S =*3 4+*S310

  • 8/14/2019 multi user chat.doc

    66/75

    lst ntelliSense.Visible 4alse 3nd f

    3nd Sub

    !ublic Sub Send(ata)Te"t +s String-

    f wsc.State @ Then wsc.Send(ata Te"t Seperator 3nd f

    3nd Sub

    !rivate Sub Sign n)-

    mod(eclaration.Sign n 4alse frm/onnect.Show vb&odal

    f ot mod(eclaration.Sign n Then nload &e 3lse 5 %T %T... /aption OV=&essenger $ egistered as O mod(eclaration. sername wsc./onnect mod(eclaration.Server !, A? 3nd f

    3nd Sub

    !rivate Sub tmr/onnectXTimer)-

    5 \ it is ?0sec long tried to connect to

    Time%ut/ Time%ut/ M ? f wsc.State @ Then Time%ut/ 0 Status=ar.SimpleTe"t O elation... Send *ogin e#uest...O tmr/onnect.3nabled 4alse tmr*ogin.3nabled True Send(ata OloginWO mod(eclaration. sername OWO mod(eclaration. ser!ass 3"it Sub 3nd f f Time%ut/ ?0 Then Status=ar.SimpleTe"t O t could not be contacted...O (isconnected Sign n 3nd f

    3nd Sub

    !rivate Sub tmr/onnection/heckXTimer)-

    5 \ once the connection is this timer is active and check whether they still5 is connected to the server

    f wsc.State 0 %r wsc.State A Then Status=ar.SimpleTe"t OThey were separated from the server...O

  • 8/14/2019 multi user chat.doc

    67/75

    (isconnected Sign n 3nd f

    3nd Sub

    !rivate Sub tmrDet(ataXTimer)-

    5The check comes in a timerU52'IU5 t5s simple ....5+ccepted, it goes to a message, and that is precisely verarbeitei in this loop,5=ut in 2insock (ataX+rrival. Then there are big problems if (uring these (erivative 2ork,a5+nother packet arrived^ )sounds funny, but it iss-

    (im temp +s *ong (o 2hile nStr)?, eceive=uffer, Seperator- ; 0 temp nStr)?, eceive=uffer, Seperator- f temp ; ? Then 4i"ed(ata+rrival *eft ) eceive=uffer, temp $ ?- 3nd f eceive=uffer &id ) eceive=uffer, temp M *en)Seperator-- *oop

    3nd Sub

    !rivate Sub tmr*oginXTimer)-

    5 \ + timeout timer ... will be disabled once the login has been accepted by the server 5 and enabled as soon as one is connected

    tmr*ogin.3nabled 4alse Status=ar.SimpleTe"t OThe server is not responding to the login re#uest...O (isconnected Sign n

    3nd Sub

    !rivate Sub tmrTypeXTimer)-

    tmrType.3nabled 4alse Send(ata OtypingWfalseO

    3nd Sub

    !rivate Sub pdate*st) sername +s String, X %nline +s String-

    5 \ The server sends the list of users5 he does so only when a new user has logged on

    (im n*st +s =oolean

  • 8/14/2019 multi user chat.doc

    68/75

    (im +s nteger (im 3 +s nteger (im Selected ser +s String

    n*st 4alse 5 you never know... 4or ? To lst=uddys.*ist/ount f lst=uddys.*ist tems) - sername Then n*st True 3 3"it 4or 3nd f e"t f %nline OtrueO +nd ot n*st Then lst=uddys.+dd tem sername 3lse f ot %nline OtrueO +nd n*st Then 5 %T % * 3... lst=uddys. emove )3- 3nd f

    f %nline OtrueO Then !laySound ser%nline3nd Sub

    !rivate Sub serTyping) sername +s String, X sTyping +s String, +dmin +s String-

    (im +s nteger (im 3 +s nteger (im nType+rray +s =oolean(im Strte"t +s String

    4or ? To =ound)Typing- f sername Typing) -. sername Then nType+rray True 3 3"it 4or 3nd f e"t f ot nType+rray Then e(im !reserve Typing) =ound)Typing- M ?- 3 =ound)Typing- Typing)3-. sername sername 3nd f Typing)3-.Typing ) sTyping OtrueO- 5 T%(% 3 0 4or ? To =ound)Typing- f Typing) -.Typing Then Strte"t Strte"t Typing) -. sername O,O 3 3 M ? 3nd f e"t f ot 3 0 Then Strte"t *eft )Strte"t, *en)Strte"t- $ ?- f 3 ? Then Strte"t Strte"t O makes an entryO 3lse 5 %T 3...

  • 8/14/2019 multi user chat.doc

    69/75

    Strte"t Strte"t O makes an entryO 3nd f 3nd f Status=ar.SimpleTe"t Strte"t 5 $; there is an array, since the user only occurs once

    5 $; The e now gives the stay in the array

    3nd Sub

    !rivate Sub Voice) sername +s String, Voice3nabled +s String, +dmin +s String-f Voice3nabled OenabledO Then

    +ddTe"tTo T= sername O has entered the Voice /hatO, 3vent/olor, True, True3lse +ddTe"tTo T= sername O has left the Voice /hatO, 3vent/olor, True, True

    3nd f 3nd Sub

    !rivate Sub wscX(ata+rrival)=yVal bytesTotal +s *ong-

    (im str(ata +s String

    wsc.Det(ata str(ata eceive=uffer eceive=uffer str(ata

    3nd Sub

    !rivate Sub wscX3rror)=yVal umber +s nteger, X (escription +s String, X =yVal Scode +s *ong, X =yVal Source +s String, X =yVal 'elp4ile +s String, X =yVal 'elp/onte"t +s *ong, X /ancel(isplay +s =oolean-

    Status=ar.SimpleTe"t O t could not be contacted...O (isconnected Sign n

    3nd Sub

  • 8/14/2019 multi user chat.doc

    70/75

    S&reen !)'t

    *ogin

  • 8/14/2019 multi user chat.doc

    71/75

    &ain

  • 8/14/2019 multi user chat.doc

    72/75

    Sen" te t

  • 8/14/2019 multi user chat.doc

    73/75

    S#ile!

  • 8/14/2019 multi user chat.doc

    74/75

    V'i&e &)$t

  • 8/14/2019 multi user chat.doc

    75/75