Boxing is the process of converting a variable from value type to reference type.
example:
int i=6;
double d=85.87658;
d=Convert.ToDouble(i);
console.write(d);//it prints d value as 6.
Unboxing is the process of converting a variable from reference type to value type.
example:
int i=6;
double d=85.87658;
i=Convert.ToInt32(d);
console.write(i);//it prints i value as 86.
Friday, March 29, 2013
Thursday, March 28, 2013
Global assembly cache (GAC)
Global assembly cache is where all shared .net assembly resides. GAC is used in the following situations:
- If assemblies have to be shared among several applications which resides in the same computers.
- If the assembly has some special security, requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly the assembly file willremove the assembly.
Bright career in UK privacy policy
Bright Career in UK App does not collect or publish any personal information.If you would like to report any violations of this policy, please contact us at purnima.kodey@gmail.com.
Wednesday, March 27, 2013
Windows 8 Activation key
step 1:open CMD prompt as ADMIN step 2:type this as it is SLUI.EXE3 ENTER xxxxxxxxxx (or) slmgr.vbs -ipk JQNFG-CHJ33-P7PTY-J3Q98-BWMQP
Sunday, March 17, 2013
Structure in c#.net
A structure is a value type data type. when you want a single variable to hold related data of various data types , you can create a structure. "struct" is a keyword used to create a structure.
Like classes, structures contain data members which are defined with in the declaration of the structure.
However structures differ from classes and the differences are :
Like classes, structures contain data members which are defined with in the declaration of the structure.
However structures differ from classes and the differences are :
- structures are value types and get stored in a stack memory where as classes are reference types and stored in heap memory.
- structures do not support inheritance where as classes support inheritance.
- structures do not have default constructors.
For example if you want to maintain the employee details, such as employee id, employee name, joining date, designation, in a single variable, you can declare a structure.
The following code shows the syntax of a structure data type:
public struct employee_details
{
public string emp_id;
public string emp_name;
public string join_date;
public string designation;
};
Friday, March 15, 2013
Http handlers and Http modules
Handlers and modules helps you inject Pre-Processing logic before the ASP.NET request reaches the website.For instance before your request reaches any resource you would like to check if the user has been authenticated or not.
Httphandler is an extension based processor.In other words the pre-processing logic is invoked depending on file extensions.
Httpmodule is an event based processor. In other words ASP.NET emits lot of event like BeginRequest, AuthenticateRequest etc, we can write logic in those events using Httpmodule.
Httphandler is an extension based processor.In other words the pre-processing logic is invoked depending on file extensions.
Httpmodule is an event based processor. In other words ASP.NET emits lot of event like BeginRequest, AuthenticateRequest etc, we can write logic in those events using Httpmodule.
Wednesday, March 13, 2013
Friday, March 8, 2013
Country Information About Page
CountryInformation App gives Information about the country in the form of Capital, Currency, Currency code, Two letter ISO code, Three letter ISO code, Population, Area in KM.
Threading in C#.Net
Thread is an independent execution path, able to run simultaneously with the other threads.When you create a c# client program the CLR automatically creates a single thread .i.e the "main" thread.
Example:
using System;
using System.Threading;
namespace threading
{
class Program
{
static void Main()
{
Thread t = new Thread(display); //Creating a new thread.
t.Start(); //starts the new thread
////// Simultaneously, do something on the main thread.
for (int i = 0; i < 1000; i++)
{
//Thread.Sleep(1000);
Console.Write("rayala"+"\t"); }
Console.ReadKey();
}
public static void display()
{
for (int i = 0; i < 1000; i++)
{ //Thread.Sleep(2000);
Console.Write("sagar"+"\t"); }
}
}
}
The above example prints the "rayala" and "sagar" simultaneously.i.e two threads running parallel.Do you want to see the execution of threads uncomment the lines Thread.Sleep(1000) and Thread.Sleep(2000) in the above code.
Example:
using System;
using System.Threading;
namespace threading
{
class Program
{
static void Main()
{
Thread t = new Thread(display); //Creating a new thread.
t.Start(); //starts the new thread
////// Simultaneously, do something on the main thread.
for (int i = 0; i < 1000; i++)
{
//Thread.Sleep(1000);
Console.Write("rayala"+"\t"); }
Console.ReadKey();
}
public static void display()
{
for (int i = 0; i < 1000; i++)
{ //Thread.Sleep(2000);
Console.Write("sagar"+"\t"); }
}
}
}
The above example prints the "rayala" and "sagar" simultaneously.i.e two threads running parallel.Do you want to see the execution of threads uncomment the lines Thread.Sleep(1000) and Thread.Sleep(2000) in the above code.
Out Keyword in C#.Net
Out is a keyword which is used in c#. Generally a method returns only one value to where the call to the method is made. Suppose we want to return more than one value from a method , it is not possible.If we want to return more than one value from a method we use out key word . Just place the out keyword before the declaration of parameters in the method.
Example: public int add(out int a, out int b)
{
--------
--------
}
In the above example I declared a method add(). It has two parameters a , b of integer types. Now, when the call to this method is made , then this method returns two values of integer type.
Example:
using System;
namespace Out_Keyword
{
class Program
{
static void Main()
{
int a, b;
float f;
double d;
char c;
string s;
Display(out a, out b,out f,out d, out c, out s);
Console.WriteLine(a+"\n"+b+"\n"+f+"\n"+d+"\n"+c+"\n"+s);
Console.ReadKey();
}
public static void Display(out int a1,out int b1,out float f1,out double d1, out char c1,out string s1)
{
a1 = 5;
b1 = 6;
f1= 64.654783f;
d1 = 875.339854721;
c1 = 's';
s1 = "sagar rayala";
}
}
}
In the above example I declared method Display() with 6 parameters of int , float , double , char and string types.And I initialized the parameters with some values.
In the main() I declared variables of same types declared in the Display().And I called the Display() with variables declared in the main (). The Display() returns values to the variables.
Example: public int add(out int a, out int b)
{
--------
--------
}
In the above example I declared a method add(). It has two parameters a , b of integer types. Now, when the call to this method is made , then this method returns two values of integer type.
Example:
using System;
namespace Out_Keyword
{
class Program
{
static void Main()
{
int a, b;
float f;
double d;
char c;
string s;
Display(out a, out b,out f,out d, out c, out s);
Console.WriteLine(a+"\n"+b+"\n"+f+"\n"+d+"\n"+c+"\n"+s);
Console.ReadKey();
}
public static void Display(out int a1,out int b1,out float f1,out double d1, out char c1,out string s1)
{
a1 = 5;
b1 = 6;
f1= 64.654783f;
d1 = 875.339854721;
c1 = 's';
s1 = "sagar rayala";
}
}
}
In the above example I declared method Display() with 6 parameters of int , float , double , char and string types.And I initialized the parameters with some values.
In the main() I declared variables of same types declared in the Display().And I called the Display() with variables declared in the main (). The Display() returns values to the variables.
Monday, March 4, 2013
Privacy Policy of CountryInformation app
Country Information App does not collect or publish any personal information.If you would like to report any violations of this policy, please contact us at sagar@gmail.com.
Subscribe to:
Posts (Atom)