.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
Visual Studio .NET Tips and Tricks, VB.NET Code Samples, C# Code Snippets, ASP.NET Code Samples, .NET Tips and Tricks, C# Tips & Tricks, Visual Studio 2010, .NET Framework Code Samples, VB.NET Tips & Tricks
.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
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'
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
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!");
}
}
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 = "*"
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