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.


Tuesday, October 30, 2012

Crystal Report-An Introduction

In general, report is a proper formatted output. In .NET framework, we can create report with the help of inbuilt reporting tools called crystal report. Crystal Report is a business intelligence application which is used to generates reports from a various types of data sources. It allows users to graphically design report layout and data connections. It provides the ability to create interactive, presentation-quality content. When we think of a report then it is obvious that we want to do at least three things such as create, modify and run a report against a data in the data base.


While creating a report, some important things need to be remembered.
1. Table name
2. Kind of data from table.
3. Manipulation on data to get required and informative result.
4. Way to format the report etc.

Silverlight-An Introduction

It is a powerful development tool for creating interactive user interface for window, web and mobile application. It is an application framework for creating rich internet applications. The runtime environment is available for silverlight as free plug-in powered by the .NET framework and compatible with any browser, device and operating system.
Working with Silverlight

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

2.New Web Site window will populate.Select ASP.NET Web Site and click on button Ok.


3. In Solution Explorer, right click on project name Silverlight and select Add New Item.


4. Add New Item window will populate.Select Silverlight Application from template list and click on button Add.


5. Add Silverlight Application window will populate.Click on button Ok.


6. Silverlight Application projet window will populate.


Notes:

1. Whenever we create new Silverlight Application project, it always contains two files such as  MainPage.xaml and App.xaml as well as code behind class files that are associated with them.
2. The App.xaml file is used to declare resources, such as brush and style objects that are shared across the application. The Application code-behind class for the App.xaml file can be used to handle application level events – such as
     1. Application Startup
     2. Application Exit and
    3. Application_UnhandledException.
3. The Page.xaml file is by default the initial UI control that is loaded when the application activates. Within it we can use UI controls to define our user interface, and then handle events off of them within the Page code-behind class.
4. Whenever we build our project, Visual Studio will by default compile the code and .XAML markup into a standard .NET assembly file, and then package it into .xap file.
5. Xap file is a compressed result of the silverlight application which contains application manifest file, compiled output assembly and other recourses used by silverlight application

7. Drag a control TextBlock from Toolbox inside Grid. Add a text attribute to the TextBlock element and sets it a value of “Hello World.”We can see Hello World in the Grid. in the below mentioned screenshot.


8. Run the application by pressing F5 and it will launch test web page that hosts our application.


Copyright © Codingnodes,2014.All Rights Reserved.