Windows Phone Developers

Wednesday, December 23, 2009

Where are the .NET DLLs available in the system

.NET DLLs (3.0 and above)are available @ C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5

Or

C:\Windows\Microsoft.NET\Framework\v2.0.50727

C# .NET DLLs, System DLLs in Windows



.NET DLL Location.NET DLL Location


.NET DLL Location.NET DLL Location

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

Cannot implicitly convert type 'System.Diagnostics.Process[]' to 'System.Diagnostics.Process'

The compiler requires an explicit conversion. For example, you may need to cast an r-value to be the same type as an l-value. Or, you must provide conversion routines to support certain operator overloads.

Process oProcess;

oProcess = Process.GetProcessesByName(sProcessName);

Since GetProcessesByName creates an array of new Process components and associates them with the existing process resources that all share the specified process name, we need to declare oProcess as shown below:

Process[] oProcess;

oProcess = Process.GetProcessesByName(sProcessName);

C# Error Cannot implicitly convert type 'System.Diagnostics.Process[]' to 'System.Diagnostics.Process', .NET Error Cannot implicitly convert type 'System.Diagnostics.Process[]' to 'System.Diagnostics.Process'

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

Cannot declare instance members in a static class

This error occurs if you declare a non-static member in a class that is declared static. It is not possible to create instances of static classes, so instance variables would not be meaningful. The static keyword should be applied to all members of static classes.

In this example get_application_process is not declared as static

static class Program

{

private void get_application_process()

{

Process apProcess;

String sModuleName;

}

Solution:

private static void get_application_process()

should solve the problem

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

The type or namespace name 'Process' could not be found (are you missing a using directive or an assembly reference?)

Yes, the using directive is missing!

using System.Diagnostics;

Should solve the problem

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

How to check user input in C# (.NET) / VB.NET

How to parse user input using C# (.NET)

Many times we do not get the anticipated input from the user (either as direct entry / through some input files). Converting the input, for example, to say integer can be done as shown below

public static void TryParse_Examples()

{

bool bConversion;

int result;

// Failure //

bConversion = int.TryParse(null, out result);

if (bConversion == false)

{

MessageBox.Show ("Error Occurred!");

}

// Failure //

bConversion = int.TryParse("s1", out result);

if (bConversion == false)

{

MessageBox.Show("Error Occurred!");

}

// Success //

bConversion = int.TryParse("100", out result);

if (bConversion == false)

{

MessageBox.Show("Error Occurred!");

}

}

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

Saturday, June 13, 2009

How to mask the Password text in Textboxes (in VB.NET / C#)

It is simple to mask the characters entered in a textbox by setting the PasswordChar Property

The same can be done using C# code as shown below:

TextBox2.PasswordChar = "*"



Text Box without Mask
PasswordChar Property in TextBox

Masked Textbox


Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

Frame Control in VB.NET / C#

GroupBox control in .NET (Vb/C#)

GroupBox and Panel control provide the functionality similar to the Frame control in visual basic 6.0. Drag and Drop the Frame Control to the form and set its properties accordingly




Alter the properties from properties dialog box




Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon