Saturday, November 24, 2012

HTTP request without browser

For this we use WebRequest class.This class  has a GetResponse() method that is used to send request to the address specified by URL.

Steps to be followed:
1.Start Visual Studio and open Console Application.
2.Add two namespaces using System.Net and using System.IO.
3.Add following code mentioned in the below screenshot in method
static void Main(string[] args){}

4.Run the program by pressing Ctrl+F5.Visual Studio starts a Console for us and runs the program.After a couple of moments, we can see some HTML on your screen.

Sunday, November 11, 2012

SQL Injection-An Introduction

SQL Injection is a technique to potentially impact the system of web world. It is used to take advantage of available vulnerable points of the system. It is just like inserting a SQL statement to be run on our database without information and confirmation to take full advantage of weak point. For example, in a registration or login page of a web system, instead of entering required information we used to enter SQL statement and force to run on our database to get their information from the database.
For example let's take a SQL statement
Select * from employee where first_name='"+first_name+"';
Here user is asked to enter first name and if user enter first_name as pawan then SQL statement would be similar to Select * from employee where first_name='pawan';
But if user enter first_name as pawan;drop table employee-- then SQL statement would be similar to  
Select * from employee where first_name='pawan';drop table employee--
Here the semicolon (;) denotes the end of one query and the start of another. The double hyphen (--) indicates that the rest of the current line is a comment and should be ignored. Here the modified code is syntactically correct and hence it will be executed by the server. But when SQL Server processes this statement, SQL Server will first select all records in employee where first_name is pawan. Then, SQL Server will drop table employee.


Saturday, November 10, 2012

WPF-DataBinding-Example1

Working with WPF
Steps to be followed:

1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control StackPanel to MainWidow.xaml page.

3.Place the code selected in the below screenshots in between StackPanel tag.

4.Run the application by pressing F5 and see the output according to color we selected from the ListBox as below.






Saturday, November 3, 2012

WPF-Animation(Rotating balls moving along the path of ellipses)-Part Two

Working with WPF

Steps to be followed:
1.Start Visual Studio and follow the same path as mentioned in article. http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control Canvas to MainWidow.xaml page.
3.Place the code selected in the below screenshots in between Canvas tag.


4.Change the code in the specified class as given in the below screenshot.


5.Run the application by pressing F5 and rotating ball would be output as in below screenshot.




WPF-Animation-Part One

Working with WPF
Steps to be followed:
1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control DockPanel and Ellipse to MainWidow.xaml page.

3.Place the code selected in the below screenshot in between DockPanel tag.

4.Run the application by pressing F5 and animated ouput is in as in below screenshot.




Friday, November 2, 2012

WPF-Shape Drawing(Cylinder)-Part Two

Working with WPF
Steps to be followed:
1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html

2.Drag a control Canvas to MainWidow.xaml page and give dimensions (400,500).
3.Place the code selected in the below screenshot in between Canvas tag.

4.Run the application by pressing F5 and ouput is as in below screenshot.

WPF-Shape Drawing(Indian Flag)-Part One

A Shape is a type of UIElement that provides the functionalities to draw a shape to the screen and since it is UIElement, Shape objects can be used inside Panel elements and most controls.

WPF provides a number of predefined Shape objects that are inherited from the Shape class.
The Shape objects provided by Shape class are Line, Path, Rectangle, Polygon, Polyline and Ellipse. All Shape objects share some common properties such as Stroke, StrokeThickness and Fill.
Canvas panel is used to panel. So we will be considering it most of the time.
Drawing the Indian Flag
Steps to be followed.
1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control Canvas to MainWidow.xaml page and give dimensions (300,300).
3.Place the code selected in the below screenshot in between Canvas tag.

.
4.Run the application by pressing F5 and ouput is as in below screenshot.



Window Presentation Foundation - An Introduction

It is a formative, representative and graphical user interface framework provided by Microsoft to create interactive, dynamic and rich user experience. We can say that it is next generation user interface framework. It allows developing easily window applications. It coalesces application user interfaces, 2D graphics, 3D drawing, document and multimedia into one single architectural framework. It enables us to create visually stunning user interface.
Working with WPF

Steps to be followed:
1. Start Visual Studio and go to File->New->Project


2. New Project window will populate. Select WPF Application. Change name as we have changed to WpfExample and click on button OK .


3. WpfExample window will come and we can see App.xaml and MainWindow.xaml


Notes:
1. App.xaml (corresponding code file, App.xaml.cs or App.xaml.vb) which is used to store resources and provide availability throughout the entire window in our application and hence works as a global file for application wide declarations.
2. MainWindow.xaml is same as .aspx page in ASP.NET.Here XAML is used as markup language to create UI.

4. Place the code shown in below screenshot in between  .
                          

5. Run the application by pressing F5 and we can see the output as below.


Copyright © Codingnodes,2014.All Rights Reserved.