Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Archive for December, 2009

Pause a Console Application for User Input


Pause a Console Application for User Input or Pause Command in a Console Application

While working with C# or VB.NET Console Applications, you may require to pause for the user input or display a message to the user. Console application window get exit as the program execution finished. Following Piece of code will do it for you.

C#.NET

using System;
using System.Collections.Generic;
using System.Text;
 
namespace Pause {
   class Program {
      static void Main(string[] args)
    {
     Console.WriteLine("Press any key to continue…");
     Console.ReadLine(); //Pause
    }
   }
}


Read the rest of this entry »

Read XML data from a URL by using Visual C#


Read XML data from a URL by using Visual C#

C# has a powerful and flexible namespace System.Xml to manipulate XML. System.Xml namespace provides the XMLTextReader class to read XML (Extensible Markup Language) from a URL (Uniform Resource Locator).

Now we want to read xml file test.xml (http://localhost/test.xml) located at your localhost. You can also use www.tipsntracks.com site map at "http://www.tipsntracks.com/sitemap.xml". let us look at structure of test.xml, I am going to used.


Read the rest of this entry »

Finding Last line in the text using regular expressions with .net


Finding Last line in the text using regular expressions with .net

In this regular expressions, we are going to find last line in the text.

Regular Expression Pattern

.+Z$

A description of the regular expression:

Any character, one or more repetitions
End of string or before new line at end of string
End of line or string

How It Works

This regular expression will check for Any character, one or more repetitions of End of string or before new line at end of string.


Read the rest of this entry »

Finding First line in the text using regular expressions with .net


Finding First line in the text using regular expressions with .net

In this regular expressions, we are going to find first line in the text.

Regular Expression Pattern

\A.*

A description of the regular expression:

Beginning of string
Any character, any number of repetitions

How It Works

This regular expression will check for Beginning of line followed by Any character.


Read the rest of this entry »

Finding each line in the text using regular expressions with .net


Finding each line in the text using regular expressions with .net

In this regular expressions, we are going to find each line in the text.

Regular Expression Pattern

^.*$

A description of the regular expression:

Beginning of line or string
Any character, any number of repetitions
End of line or strin

Sucessful Matches

This is a test.
What you want?
That’s great!
as shown below:


Read the rest of this entry »