VB and C# Programming Basics. Overview Basic operations String processing Date processing Control structures Functions and subroutines.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
Basics of ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Installing ASP.NET and Web Matrix Data Types Branching Structure Procedures.
Information Technology Center Hany Abdelwahab Computer Specialist.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Introduction to scripting
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Course Textbook: Build Your Own ASP.Net Website: Chapter 2
CST JavaScript Validating Form Data with JavaScript.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
4.1 JavaScript Introduction
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Using Visual Basic 6.0 to Create Web-Based Database Applications
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
School of Computing and Information Systems CS 371 Web Application Programming PHP - Basics Serving up web pages.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
1 CLIENT-SIDE SCRIPTS. Objectives 2 Learn how to reference objects in HTML documents using the HTML DOM and dot syntax Learn how to create client-side.
Chapter 3 : Processing on the Front End JavaScript Technically its name is ECMA-262, which refers to the international standard which defines it. The standard.
Language Elements 1. Data Types 2 Floating Point (real) Single Precision Double Precision Decimal Fixed Point (integer) Byte Short Integer Long Numerical.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction to Arrays in Java Corresponds with Chapter 6 of textbook.
CompSci Today’s topics Java Review Just a bunch of headings meant to trigger questions A contraction of previous notes Upcoming Midterm Exam Reading.
Arrays Part 9 dbg. Arrays An array is a fixed number of contiguous memory locations, all containing data of the same type, identified by one variable.
PHP - Basic Language Constructs CSCI 297 Scripting Languages - Day Two.
Freemarker ● Introduction ● Core features ● Java part example ● Template example ● Expressions ● Builtins ● Assigning value ● Conditions ● Loops ● Macros.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
4.4 JavaScript (JS) Deitel Ch. 7, 8, 9, JavaScript & Java: Similarities JS (JavaScript) is case-sensitive Operators –arithmetic: unary +, unary.
Applications Development
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Introduction To JavaScript. Putting it Together (page 11) All javascript must go in-between the script tags. All javascript must go in-between the script.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Creating a Java Application and Applet
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Object-Oriented Application Development Using VB.NET 1 Chapter 4 VB.NET Programming with Supplied Classes.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Javascript Intro Instructor: Shalen Malabon. Lesson Plan Core Javascript Syntax Types and Objects Functions DOM Event Handling Debugging Javascript Smarter.
Session 02 Module 3: Statements and Operators Module 4: Programming constructs Module 5: Arrays.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
CSC 121 Computers and Scientific Thinking Fall Event-Driven Programming.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
Chapter 9 Introduction to Arrays Fundamentals of Java.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
CGS 3066: Web Programming and Design Spring 2017
CS 371 Web Application Programming
JavaScript Syntax and Semantics
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
PHP.
Web Programming and Design
Presentation transcript:

VB and C# Programming Basics

Overview Basic operations String processing Date processing Control structures Functions and subroutines

Additional Documentation For extensive documentation in Microsoft.NET Development using VB or C#: –

The System Namespace Contains fundamental classes, including String and DateTime System Namespace Documentation – us/library/system.aspxhttp://msdn.microsoft.com/en- us/library/system.aspx

String Processing Concatenation String length Substrings Changing case Replacing text Hyperlink to String class documentation

String concatenation

Note: C# is case sensitive. Length property begins with upper-case “L” Returning string lengths

Substring method of String class. 1 st argument = start position 2 nd (optional) argument = length of substring

Indexof method of String class Returns the 0-based index position of the substring in the searched string. Syntax: searchedString.Indexof (stringToFind) searchedString.Indexof (stringToFind, startPos)

Changing case

Replacing text in a string

The DateTime Class Provides many useful properties and methods related to dates and times Hyperlink to DateTime documentation

Date Manipulation Lots of methods and properties for the DateTime class!

Additional Notes In C#, use DateTime.Parse static method to convert a string to date. Not necessary in VB. –Try changing from DateTime.Now to a string representing a date and time To make the view source more readable, you can insert line breaks in your output string: –“\n” for C# –ControlChars.CrLf for VB

Control Structures Selection –if – else –select case switch Looping –for loops –while and do while loops

Syntax for if statements in C# is identical to what you know from Java

VB Select-Case like before

Note: C# switch statement allows case to include strings…different from Java, which requires integral values

for loop syntax similar to what you know of Java

Note: unlike Java, C# includes a foreach keyword in the core language.

while in C# is similar to what you know already in Java

Functions and Subroutines Signatures – return type, name, parameter list Calling functions and subroutines Making use of return values

Note: with VB.NET, explicit type declarations not necessary Note the use of ToString method…converts numeric values to strings for text output.

Note that the int data type (and other primitive data types) provides the possibility of converting data to string via ToString(). In this sense it operates like a Java wrapper class.

Array Processing Topics: –Array declaration, instantiation, initialization –Single-dimensional arrays –Multi-dimensional arrays –Jagged arrays

Single Dimension Arrays C# Declaration in C# is strict, brackets must follow data type: int[] array1; NOT int array1[]; Looping through arrays can be done using Length property or via for each loop

Single Dimension Arrays VB

Multi Dimension Arrays C# Multi-dimension array declaration and use in C# is unlike Java. With Java you are always declaring jagged arrays, but C# has a feature for multi-dimension arrays

Multi Dimension Arrays VB Length vs. GetLength(): Length returns full array size GetLength(x) returns nbr elements in row x

Jagged Arrays C# Jagged arrays are familiar to Java programmers

Jagged Arrays VB

Web Server Controls for Assignment #1 TextBox –Two Useful Properties: Text – contains the string for user input Columns – specifies visible number of characters Button –Event processing via ONCLICK attribute in ASP:Button tag Label –Static text display

Note initialization of server control properties in the Page_Load procedure Association of click event with event-handling routine

Resulting HTML code Resulting browser render

The web.config file Useful for deployment and configuration Primarily for web administration Can also be used for creating global application variables XML file If used, should be placed in application’s root folder For debugging purposes, you should do the following…… In your web.config file, change the tag that says: – To – This will enable compile errors in your code to be identified when attempting to view the page in a browser