Showing posts with label C Sharp. Show all posts
Showing posts with label C Sharp. Show all posts

Desktop Application vs Web Application

1 comments
An Application is a set of instructions to achieve a particular task for end users. An application can be divided into two general classes: Desktop Application and Web Application.

  1. Desktop Application: The application developed to run in a particular system is called Desktop Application.
  2. Web Application: The application developed to run in server system so that it will be run on different client systems is called Web Application or Web-based Applications.

Benefits of a Web Application:


  • A web application is any application that uses a web browser as a client. The application can be as simple as a message board or a guest sign-in book on a website, or as complex as a word processor or a spreadsheet.
  • A web application relieves the developer of the responsibility of building a client for a specific type of computer or a specific operating system. Since the client runs in a web browser, the user could be using an IBM-compatible or a Mac. They can be running Windows XP or Windows Vista. They can even be using Internet Explorer or Firefox, though some applications require a specific web browser.
  • Web applications commonly use a combination of server-side script (ASP, PHP, etc) and client-side script (HTML, Javascript, etc.) to develop the application. The client-side script deals with the presentation of the information while the server-side script deals with all the hard stuff like storing and retrieving the information.
Continue Reading...

What is a Client?

0 comments
The 'client' is used in client-server environment to refer to the program the person uses to run the application. A client-server environment is one in which multiple computers share information such as entering information into a database. The 'client' is the application used to enter the information, and the 'server' is the application used to store the information.
Continue Reading...

C Sharp program to find largest of given 3 numbers

2 comments

using System;

namespace largetOfThreeNums
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, big;
            Console.Write("Enter First value: ");
            a = int.Parse(Console.ReadLine());
            Console.Write("Enter Second value: ");
            b = int.Parse(Console.ReadLine());
            Console.Write("Enter Third value: ");
            c = int.Parse(Console.ReadLine());
            big = a;
            if (b > big)
                big = b;
            if (c > big)
                big = c;
            Console.WriteLine("Biggest of given 3 numbers = " + big);
            Console.ReadLine();
        }
    }
}
Continue Reading...

Visual Studio Tips and Tricks!

0 comments
Editor’s Favorites
CTRL+SHIFT+B or F7 to build your solution
CTRL+] to jump between matching braces!
The IntelliSense Suggestion Box
CTRL+K+Pit re-opens the suggestion box.
CTRL+J shows only members in the IntelliSense completion list.
Format your Code
CTRL+K+D to auto-format your code
CTRL+K+C to Comment a block of code
CTRL+K+U to Uncomment a block of code
CTRL+E+D or CTRL+E+C or CTRL+E+U
CTRL+M or CTRL+L
will collapse/expand all outlining.
CTRL+M+O or CTRL+M+P to open and close all regions of code.
CTRL+K, CTRL+C/CTRL+U to comment/uncomment a selection.
Debugging
F10, F11Step Over, Step Into a statement
CTRL+ALT+H display the Thread List window.
CTRL+ALT+M display the Memory window.
CTRL+ALT+C
ALT+7
display the call stack window.
ALT+3 display the Watch window
General Keyboard shortcuts
F7Toggles between design and code views.
F9Toggles breakpoint.
F12Go to definition of a variable, object, or function.
Ctrl+Shift+7
Ctrl+Shift+8
Quickly navigate forward and backwards in the go to definition stack.
Shift+F12Find all references of a function or a variable.
Ctrl+M, Ctrl+MExpand and collapse code outlining in the editor.
Ctrl+K, Ctrl+C
Ctrl+K, Ctrl+U

Comment and uncomment line(s) of code, respectively.
Shift+Alt+EnterToggles between full screen mode and normal mode.
Ctrl+IIncremental Search.
Continue Reading...

C# program for converting a number into words (spell)

1 comments

using System;
//wirtten by Suneel Gudipati
namespace NumberToWords
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] units = new string[] { "ONE ", "TWO ", "THREE ", "FOUR ", "FIVE ", "SIX ", "SEVEN ", "EIGHT ", "NINE ", "TEN ", "ELEVEN ", "TWELEVE ", "THIRTEEN ", "FOURTEEN ", "FIFTEEN ", "SIXTEEN ", "SEVENTEEN ", "EIGHTEEN ", "NINTEEN " };
            string[] tens=new string[]{"TEN ","TWENTY ","THIRTY ","FOURTY ","FIFTY ","SIXTY ","SEVENTY ","EIGHTY ","NINTY "};
            int i,num;
            string result="";
            Console.Write("Enter number here in range 1-999 : ");
            num = int.Parse(Console.ReadLine());
            if (num >99&&num<1000)
            {
                i=num/100;
                result=units[i-1]+"HUNDRED ";
                num =num%100;
            }//if
            if (num>19&&num<100)
            {
                i=num/10;
                result =result+tens[i-1];
                num=num%10;
            }//if
            if (num<20&&num>0)
                result+=units[num-1];
            Console.WriteLine("The number you entered: "+result);
            Console.ReadLine();
        }
    }
}

Continue Reading...

Difference between .NET 2.0/3.0/3.5 Framework

8 comments

NET framework 2.0:

It brings a lot of evolution in class of the framework and re-factor control including the support of
  • Generics
  • Anonymous methods
  • Partial class
  • Null-able type
  • The new API gives a fine grain control on the behavior of the run time with regards to multithreading, memory allocation, assembly loading and more
  • Full 64-bit support for both the x64 and the IA64 hardware platforms
  • New professionalization features for ASP.NET, such as support for themes, skins and webparts.
  • .NET Micro Framework

.NET framework 3.0:

Also called WinFX, includes a new set of managed code APIs that are an integral part of Windows Vista and Windows Server 2008 operating systems and provides
  • Windows Communication Foundation (WCF), formerly called Indigo; a service-oriented messaging system which allows programs to inter-operate locally or remotely similar to web services.
  • Windows Presentation Foundation (WPF), formerly called Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies.
  • Windows Workflow Foundation (WF) allows for building of task automation and integrated transactions using work-flows.
  • Windows CardSpace, formerly called InfoCard; a software component which securely stores a person's digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website

.NET framework 3.5:

It implement Linq evolution in language. So we have the folowing evolution in class:
  • Linq for SQL, XML, Dataset, Object
  • Addin system
  • p2p base class
  • Active directory
  • ASP.NET Ajax
  • Anonymous types with static type inference
  • Paging support for ADO.NET
  • ADO.NET synchronization API to synchronize local caches and server side datastores
  • Asynchronous network I/O API
  • Support for HTTP pipelining and syndication feeds.
  • New System.CodeDom namespace.
In simplly,
  • .Net framework 2.0 shipped with Visual Studio 2005
  • .Net framework 3.0 is same framework as .Net 2.0 + Windows Communication Foundation (WCF)+ Windows Presentation Foundation (WPF) + Windows Workflow Foundation (WF)
  • .Net framework 3.5 is all the above (.Net 3.0) + LINQ technologies and will ship with the next VS including VB 9.0 and C#
Note:
Earlier .NET 2.0, there have been 2 versions of .NET released. They are as follows :

  • .NET 1.0 – released on January 16, 2002.
  • .NET 1.1 – released on April 24, 2003.
  • .NET 2.0 – Released on November 7, 2005.
Continue Reading...

Software Development Life Cycle (SDLC)

19 comments
Software Development Life Cycle or SDLC is a model of a detailed plan on how to create, develop, implement and eventually fold the software. It’s a complete plan outlining how the software will be born, raised and eventually be retired from its function. Although some of the models don’t explicitly say how the program will be folded, it’s already common knowledge that software will eventually have it’s ending in a never ending world of change web, software and programming technology.

Various faces in the SDLC:
  1. Systems Investigation: In this face, identify systems problems or opportunities.
  2. Systems Analysis: In this face, how can we solve the problems.
  3. Systems Design: In this face, select and plan the best solution.
  4. Systems Implementation: In this face, place solution into effect.
  5. Systems Maintenance and Review: In this face, evaluate the results of the solutions.
Continue Reading...

Indexers

0 comments
  • Indexer is a concept of using an object like an array.

    Syntax:

    <modifier> <return type> this [argument list]

  • Indexers are implemented through get and set assessors for the [] operator. . The get and set assessors are invoked as methods with the parameter list specified in the indexer declaration.
  • Indexer method name must be this.
  • One class can have only one indexer.
  • The modifier can be private, public, protected or internal.
  • Indexers must be instance-based, that is, they cannot be static i.e., C# don't have the concept of static indexers
  • A base class indexer is inherited to the derived class.
Continue Reading...

Generics

0 comments

Whenever more than one function having same functionality, then instead of writing many functions one generic function is sufficient. In Generics, data types are decided at run time.

Syntax:

public void genericName <T> (Ta, Tb)

{

Statement(s)

}

Continue Reading...

Reflection

0 comments
  • Reflection is a mechanism which is used to access Meta data information of an assembly.
  • System. Reflection can be used to browse through the Meta data information.
  • Using reflection you can also dynamically invoke methods using System.Type.Invokemember.
Continue Reading...

How can you view an assembly?

0 comments
  • You can view an assembly by using ILDASM.
  • The ILDASM converts the assembly into IL code. To run ILDASM you have to go "C:\Program Files\Microsoft Visual Studio .Net 2003\SDK\<version>\Bin\"
  • Run the ILDASM.EXE from the path you will be pooped with the ILDSAM program.
  • Click the file and browse to the respective directory for the DLL whose assembly you want to view.
Continue Reading...

How many classes can a single .Net Dll contains?

0 comments

It can contain many classes.

Continue Reading...

How’s the DLL Hell problem solved in .NET?

0 comments

Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

Continue Reading...

Satellite Assemblies

0 comments
  • A collection of resource files (.resx) is called Satellite assembly, where a resource file stores language specific information in XML format.
  • When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
  • The namespaces to create a localized application System.Globalization, and System.Resources.
Continue Reading...

If you have two versions of same assembly in GAC how do we make choice?

0 comments
In order to use old version of an assembly, open App.config and interchange oldVersion and newVersion values in bindingRedirect section.
Continue Reading...

Assembly Versioning

0 comments
In order to create a new version of existing assembly...

  • In AssemblyInfo.cs of existing assembly change [assembly: AssemblyVersion("1.0.0.0")] to [assembly: AssemblyVersion("2.0.0.0")]
  • Rebuild the class library and publish again using gacutil.
  • Recompile the application , it now uses Version 2.0
  • Verify at C:\Windows\assembly , two entries for the class library exists.
Continue Reading...

Steps for using a Shared assembly

0 comments
  • In the .Net IDE, from the File menu, choose New and then choose Project. The New Project window opens.
  • From Project menu, select Add Reference to the above created dll through Browse (dll would be present in the path of where you create)
Continue Reading...

Steps to create Shared assembly

0 comments
  1. Create a new Class library file from .Net IDE.
  2. Write the required code.
  3. Compile the class library. It will produce a .dll at bin\debug\ folder which is called as an assembly.
  4. In order to register an assembly with in a GAC, it is mandatory that the assembly should define with the strong name.

    To do, in the .Net Command prompt

    ..\>sn –k <filename>.snk

  5. In IDE, through Solution Explorer ,open AssemblyInfo.cs and change [assembly: AssemblyVersion("1.0.*")] to [assembly: AssemblyVersion("1.0.0.0")]
  6. Also, change [assembly: AssemblyKeyFile] to [assembly: AssemblyKeyFile(@"<strongNameFilePath>)]
  7. Open a the class library file and write the required code, then rebuild the project.
  8. Then register the assembly definition within GAC using gacutil command at .Net command prompt.

    ..\>gacutil –i <dll_file_path>

  9. Verify at C:\Windows\Assembly, an entry of new dll exists.
Continue Reading...

Shared Assemblies

0 comments
  • Shared Assembly can be used by multiple applications.
  • Only one copy of Shared assembly exists per a machine.
  • An assembly is shared by instantiating it to Global Assembly Cache (GAC) which is located at C:\Windows\Assembly
Continue Reading...

Private Assemblies

0 comments
  • Private Assembly is an assembly that is used by only one application.
  • It is integral to the application.
  • They don't have versions & identity issues.
Continue Reading...
> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger