Window Programming

Course Information
Course Title:    Windows Programming
Course Code:   CoSc4152
CP/ECTS :       5
Target Group:  3 rd year CS Students
Students Workload :              
              Lecture:  2hours
              Lab.:  3 hours
              Tutorial.   2 hours
Academic Year: 2019
Semester: II
Schedule

        Section A:
                   Monday: 4:10-6:00 
                   Friday :   7:30-11:30
       Section B:
                   Monday: 2:10-4:00 
                   Thursday :   2:10-6:00

Learning Outcomes
At the end of the course students will be able to:
  • Identify the visual programming Environment and Programming applications correctness, verification and validation. 
  • familiar with Programming tools, Visual C# as a rapid application development (RAD) environment Component development and reusability, Designing and customizing forms 
  • Use Visual C# Visual C#.Net to create a small windows application that access various types of data files to perform add change and delete operations on the data. 
  • Create applications using standard and custom controls.
  • Write several small Visual C# applications to gain experience with additional topics. Solve problems and build employ ability skills such as attitude, critical thinking, reading, teamwork, work ethic, and writing.


Detail Course Contents focus

Lecture 1:     Differentiate Appln Dev't using C# 

Console Application Development: an application that can be run in the command prompt in Windows. 
A console application, in the context of C#, is an application that takes input and displays output at a command line console with access to three basic data streams: standard input, standard output and standard error. 
A console application facilitates the reading and writing of characters from a console - either individually or as an entire line. It is the simplest form of a C# program and is typically invoked from the Windows command prompt. A console application usually exists in the form of a stand-alone executable file with minimal or no graphical user interface (GUI).

he program structure of a console application facilitates a sequential execution flow between statements. Designed for the keyboard and display screen, a console application is driven by keyboard and system events generated by network connections and objects.
A console application is primarily designed for the following reasons:


  • To provide a simple user interface for applications requiring little or no user interaction, such as samples for learning C# language features and command-line utility programs.
  • Automated testing, which can reduce automation implementation resources.
Console applications developed in C# have one main entry point (static main method) of execution, which takes an optional array of parameters as its only argument for command-line parameter representation.
The .NET Framework provides library classes to enable rapid console application development with output display capability in different formats. System.Console (a sealed class) is one of the main classes used in the development of console applications.

To work with console applications in .NET you have to use a class called Console that is available within the namespace System, which is the root namespace.

Console Application in C#To read a line of text from the console window, you use the Console.ReadLine() method.
This will read an input stream  from the console window and return the input string when user presses the Enter Key.

There are also two methods for writing to the console, which are used extensively

  • Console.Write() — Writes the specified value to the console window.
  • Console.WriteLine() — This does the same, but adds a newline character at the end of the output.
Example:
The below C#.NET code lets the user input a line of text and displays that text

string s = Console.ReadLine();
Console.WriteLine(s);


To write C# console program ,
Open Visual Studio ->File -> New Project ->Visual C#-> select Console Applications 



 Window Form Application Development
Windows Forms is a Graphical User Interface(GUI) class library which is bundled in .Net Framework. Its main purpose is to provide an easier interface to develop the applications for desktop, tablet, PCs. It is also termed as the WinForms. The applications which are developed by using Windows Forms or WinForms are known as the Windows Forms Applications that runs on the desktop computer. WinForms can be used only to develop the Windows Forms Applications not web applications. WinForms applications can contain the different type of controls like labels, list boxes, tooltip etc.
  Win Form app focus as:
  • A program that is written to run under Microsoft's Windows operating system. 
  • Windows applications typically run under all 32-bit versions of Windows, but earlier
  • applications might also run under the 16-bit versions (Windows 3.x) as well.
  • runs on personal computers and work stations.
  • window based app. need to be install on your machine to access.
  • windows applications (desktop) need to be installed on each client's PC.
  • Windows application runs faster than Web application.
  • Windows application have many inbuilt classes in .Net compared to Web application.
Web Form Application Development
Web Forms used to create Web-based applications that display in a Web browser. When the Web application is run, the user interface controls display in the Web browser. Measurement Studio provides a set of user interface controls that you can use to create Web Forms applications in much the same way you create a Windows Forms application.
Web Forms controls render on the server and are typically a combination of HTML, images, and scripts that are readable by a Web browser. Because Web Forms controls render to HTML, users can view the content on different browsers, not just Internet Explorer.
Web applications require the Microsoft Internet Information Services (IIS) Web server. The Web server processes HTTP requests for ASP.NET Web pages. When a HTTP request reaches the Web server, the ASP.NET run time requests the page to render itself. Then, the page asks all of the controls that are part of the page to render themselves. The server takes the rendered content, bundles it into a HTTP response, and sends it back to the client who requested the page. The user sees the controls rendered in a Web browser.


  • Web application or webapp is an application that is accessed via Web browser over a network such such as the Internet or an intranet
  • It is a computer software application that is coded in a browser-supported language (such as HTML HTML, ASP, PHP, Perl, Python etc.) and reliant on a common web browser to render the application executable.
  • Web applications are very much useful when they are hosted.Web app. can be access from any where in the world through the internet.
  • Web application is tested mainly for browser compatibility and operating system compatibility, error handling error handling, static pages, back-end testing and load testing.
  • Web applications are programs that used to run inside some web server (e.g., IIS) to fulfill the user requests over the http the user requests over the http.
  • Common Web applications include Webmail, online retail sales, online auctions, wikis, discussion boards, Weblogs









Create Simple Login Page in ASP.Net


Login Form ASP.Net Example

There are two types of login page static login page and dynamic login page. In a static login page the username and password are fixed, only predefined user can login to site. On other side the dynamic login page works with multiple users, username and password stored in database.








Static Login Page Example in ASP.Net
Static Login Page Example in ASP.Net

Static Login Form

  • Username and password are fixed
  • Predefined user  can login
  • Does not use database
  • Write username and password values  on coding page

Dynamic Login Form

  • Username and Password are not fixed
  • Multiple use can login
  • Use Database
  • Fetch username and password values from database

Static Login Form Example in ASP.Net

In this asp.net tutorial we will create a static login page in asp.net c#.
First create website in visual studio and design a login page. In this asp.net login example we have decided first username and password values. The username = “meera” and password = “academy”.
Step 1 : Open Visual Studio –> Create New Empty Website
Step 2 : Add New Web forms
Step 3 : Design Login page with Two TextBox along with Button control.
Step 4 : Write C# code on Login Button click events.








Login ASP.Net Example
Login ASP.Net Example

C# code for above example




No comments:

Post a Comment