Welcome to MSDN Academic Alliance Seminar - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Welcome to MSDN Academic Alliance Seminar

Description:

How to write Windows Applications with C#. How to write Web ... Toggle auto hide. Visual studio .NET tools -3. Component selection. Categorized icon ... – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 21
Provided by: Rita167
Category:

less

Transcript and Presenter's Notes

Title: Welcome to MSDN Academic Alliance Seminar


1
Welcome to MSDN Academic Alliance Seminar
Todays topic
  • How to use visual studio .NET tools.
  • How to write Windows Applications with C.
  • How to write Web Applications with ASP .NET.

From 600 640 pm on Wed 9-24
Presenter Li-Ping (Rita) Chen
2
How to set up the environment
  • For Windows Application
  • Windows XP/2000/NT
  • .NET Framework SDK
  • For Web Applications
  • Windows XP/2000/NT
  • .NET Framework SDK
  • IIS(Internet Information Server)
  • Internet Explorer

PS. If you have Visual Studio software, it will
be easier to write a program.
3
Visual studio .NET tools -1
Project name
Project location
Description of selected project
4
Visual studio .NET tools -2
Title bar
Tabs
Menu bar
Toggle auto hide
toolbox
Solution Explorer
Toolbox group
Active tab
Properties window
Form (Windows application)
component control
Scroll Arrow
5
Visual studio .NET tools -3
Event icon
Component selection
Categorized icon
Alphabetic icon
Scroll bar
Property
Current value
Description
6
Visual studio .NET tools -4
Title bar
Grid
The result of building a program, or Console
interface
7
Visual studio .NET tools -5
Blue word reverse word, has some special
meaning. Black word variable name
or procedure name Green word comment
Program name
Program content
8
Start window applications with C Example 1
Welcome to Cs world
namespace TestCShape public class Form1
System.Windows.Forms.Form private bool
isClick public Form1()
InitializeComponent() isClick false
private void button1_Click(object
sender, System.EventArgs e) if
(!isClick) this.button1.Text "Welcome to C's
World!" else this.button1.Text
"Please click me!" isClick !isClick

9
Start window applications with C Example 2 a
simple calculator - 1
10
Start window applications with C Example 2 a
simple calculator - 2
switch (this.operatorType) case "Add"
this.result this.fN this.sN break
case "Sub" this.result this.fN - this.sN
break case "Mul" this.result
this.fN this.sN break case "Div"
this.result this.fN / this.sN break
this.label3.Text this.fN " "
this.operatorType " " this.sN " "
this.result
public class Form1 System.Windows.Forms.Form
private String operatorType private double
fN, sN, result .. (skip
generated by Visual Studio) private void
groupBox1_CheckeChanged(object sender,
System.EventArgs e) if (sender
this.radioButton1) this.operatorType
"Add" else if (sender this.radioButton2)
this.operatorType "Sub" else if (sender
this.radioButton3) this.operatorType
"Mul" else if (sender this.radioButton4)
this.operatorType "Div" private void
button1_Click(object sender, System.EventArgs
e) this.fN Convert.ToDouble(this.textBox1.Te
xt) this.sN Convert.ToDouble(this.textBox2.Te
xt)
11
Start web applications with ASP .NET by using
VB Example 1 welcome to ASP .NETs World - 1
12
Start web applications with ASP .NET by using
VB Example 1 welcome to ASP .NETs World - 2
WebForm1.aspx.vb
Public Class WebForm1 Inherits
System.Web.UI.Page . (skip generated by
visual studio) Private Sub
Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles
Button1.Click Me.Response.Write("Welcome
to ASP .NET's World!") End Sub
13
Start web applications with ASP .NET by using
VB Example 1 welcome to ASP .NETs World - 3
lt_at_ Page Languagevb AutoEventWireupfalse
CodebehindWebForm1.aspx.vb InheritsTestASP1.W
ebForm1gt lt!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 4.0 Transitional//EN"gt ltHTMLgt ltHEADgt
lttitlegtWebForm1lt/titlegt ltmeta
name"GENERATOR" content"Microsoft Visual
Studio.NET 7.0"gt ltmeta name"CODE_LANGUAGE"
content"Visual Basic 7.0"gt ltmeta
name"vs_defaultClientScript" content"JavaScript"
gt ltmeta name"vs_targetSchema"
content"http//schemas.microsoft.com/intellisense
/ie5"gt lt/HEADgt ltbody MS_POSITIONING"GridLayou
t"gt ltform name"Form1" method"post"
action"WebForm1.aspx" id"Form1"gt ltinput
type"hidden" name"__VIEWSTATE"
value"dDwxNTE1Mzg5MjM3OzsdGSyU5MrvgTBKEGHA9bOZoP
0WW4" /gt ltinput type"submit"
name"Button1" value"Please Click Me!"
id"Button1" style"height33pxwidth131pxZ-INDE
X 101 LEFT 144px POSITION absolute TOP
114px" /gt lta id"HyperLink1"
href"http//ltu164.ltu.edu/msdnaa"
target"_parent" style"width123pxZ-INDEX 102
LEFT 148px POSITION absolute TOP
173px"gtMSDNAAlt/agt lt/formgt lt/bodygt lt/HTMLgt
WebForm1.aspx
14
LTU MCS MSDNAA Web Site http//ltu164.ltu.edu/ms
dnaa
If we use Visual Studio to write an ASP .NET
homepage, we just need to write a very simple
file filename.aspx.vb, the other filename.aspx
will be automatically generated by Visual
Studio. See, it saves much time. PS. Now Visual
Studio is free for LTU MCS students to install
in their computers.
15
Start web applications with ASP .NET by using
VB Example 2 very simple homepage - 1
16
Start web applications with ASP .NET by using
VB Example 2 very simple homepage - 2
Private Sub Page_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load If Not
Page.IsPostBack Then
Me.DropDownList1.Items.Add("English")
Me.DropDownList1.Items.Add("French")
Me.DropDownList1.Items.Add("German")
Me.DropDownList1.Items.Add("Spanish") End
If End Sub Private Sub
Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles
Button1.Click Select Case
Me.DropDownList1.SelectedItem.Text
Case "English" Me.Label1.Text
"Hello World, " Me.TextBox1.Text
Case "French" Me.Label1.Text
"Bonjour Monde, " Me.TextBox1.Text
Case "German" Me.Label1.Text
"Hallo Welt, " Me.TextBox1.Text
Case "Spanish" Me.Label1.Text
"Hola Mundo, " Me.TextBox1.Text End
Select End Sub Private Sub
Button2_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles
Button2.Click Me.Response.Redirect("http/
/localhost/TestASP1/WebForm2.aspx") End Sub
WebForm2.aspx.vb
17
Start web applications with ASP .NET by using
VB Example 2 very simple homepage - 3
lt_at_ Page Languagevb AutoEventWireupfalse
CodebehindWebForm2.aspx.vb InheritsTestASP1.W
ebForm2gt lt!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 4.0 Transitional//EN"gt ltHTMLgt ltHEADgt
lttitlegtWebForm2lt/titlegt ltmeta
name"GENERATOR" content"Microsoft Visual
Studio.NET 7.0"gt ltmeta name"CODE_LANGUAGE"
content"Visual Basic 7.0"gt ltmeta
name"vs_defaultClientScript" content"JavaScript"
gt ltmeta name"vs_targetSchema"
content"http//schemas.microsoft.com/intellisense
/ie5"gt lt/HEADgt ltbody MS_POSITIONING"GridLayou
t"gt ltform name"Form1" method"post"
action"WebForm2.aspx" language"javascript"
onsubmit"ValidatorOnSubmit()" id"Form1"gt
ltinput type"hidden" name"__VIEWSTATE
value"dDwtNzY4MTYwMTYwO3Q8O2w8aTwxPjsO2w8dDw7bD
xpPDMOz47bDx0PHQ8O3A8bDxpPDAO2k8MT47aTwyPjtpPDM
Oz47bDxwPEVuZ2xpc2g7RW5nbGlzaD47cDxGcmVuY2g7RnJlb
mNoPjtwPEdlcm1hbjtHZXJtYW4O3A8U3BhbmlzaDtTcGFuaXN
oPjs PjsOzsOz4Oz4Oz5JIBOySErzBaH7l/WhyBh5Wdhh
YA" /gt ltscript language"javascript"
src"/aspnet_client/system_web/1_1_4322/WebUIValid
ation.js"gtlt/scriptgt ltspan id"Label1"
style"height25pxwidth311pxZ-INDEX 101
LEFT 16px POSITION absolute TOP
15px"gtlt/spangt
WebForm2.aspx.vb - 1
18
Start web applications with ASP .NET by using
VB Example 2 very simple homepage - 4
ltselect name"DropDownList1"
id"DropDownList1" style"width191pxZ-INDEX
102 LEFT 110px POSITION absolute TOP
90px"gt ltoption value"English"gtEnglishlt/op
tiongt ltoption value"French"gtFrenchlt/optio
ngt ltoption value"German"gtGermanlt/optiongt
ltoption value"Spanish"gtSpanishlt/optiongt
lt/selectgt ltinput name"TextBox1"
type"text" value"Please type your name"
id"TextBox1" style"width222pxZ-INDEX 103
LEFT 109px POSITION absolute TOP 56px" /gt
ltinput type"submit" name"Button1"
value"Send" onclick"if (typeof(Page_ClientValida
te) 'function') Page_ClientValidate() "
language"javascript" id"Button1"
style"width70pxZ-INDEX 104 LEFT 115px
POSITION absolute TOP 150px" /gt ltinput
type"submit" name"Button2" value"Reset"
onclick"if (typeof(Page_ClientValidate)
'function') Page_ClientValidate() "
language"javascript" id"Button2"
style"width67pxZ-INDEX 105 LEFT 197px
POSITION absolute TOP 150px" /gt ltspan
id"Label2" style"width62pxZ-INDEX 106 LEFT
13px POSITION absolute TOP 56px"gtnamelt/span
ltspan id"Label3" style"width88pxZ-INDEX
107 LEFT 13px POSITION absolute TOP
89px"gtlanguagelt/spangt ltspan id"RequiredFieldVa
lidator1" controltovalidate"TextBox1"
errormessage"Please fill in your name"
evaluationfunction"RequiredFieldValidatorEvaluat
eIsValid" initialvalue"" style"colorRedwidth3
08pxZ- INDEX108LEFT17pxPOSITIONabsoluteTOP
119pxvisibilityhidden"gtPlease fill in your
namelt/spangt ltscript language"javascript"gt
lt!-- var Page_Validators new
Array(document.all"RequiredFieldValidator1")
// --gt lt/scriptgt
WebForm2.aspx.vb - 2
19
Start web applications with ASP .NET by using
VB Example 2 very simple homepage - 5
ltscript language"javascript"gt lt!-- var
Page_ValidationActive false if
(typeof(clientInformation) ! "undefined"
clientInformation.appName.indexOf("Explorer") !
-1) if (typeof(Page_ValidationVer)
"undefined") alert("Unable to find
script library '/aspnet_client/system_web/1_1_4322
/WebUIValidation.js'. Try placing this file
manually, or reinstall by running 'aspnet_regiis
-c'.") else if (Page_ValidationVer !
"125") alert("This page uses an
incorrect version of WebUIValidation.js. The page
expects version 125. The script library is "
Page_ValidationVer ".") else
ValidatorOnLoad() function
ValidatorOnSubmit() if
(Page_ValidationActive)
ValidatorCommonOnSubmit()
// --gt lt/scriptgt lt/formgt
lt/bodygt lt/HTMLgt
WebForm2.aspx.vb - 3
20
Thank you!
Write a Comment
User Comments (0)
About PowerShow.com