Search results for 'C#'. 47 post(s) found.
- 2009/10/15 How to get process id in C# like windows task manager ?
- 2009/09/05 How to implement switch statement in C# ?
- 2009/09/05 How to implement while loop in C# ?
- 2009/09/04 How to delete file ?
- 2009/09/04 How to convert integer to text string ?
- 2009/09/04 How to convert text string to integer ?
- 2009/09/03 How to set an certain color as transparent color on bitmap
- 2009/09/03 How to resize and save PNG or Jpeg Image file ?
- 2009/09/03 How to display message box in C#
- 2009/09/03 How to convert bitmap image to jpeg image ?
Following is simple example to get Process name and add Process name to listbox control.
As you can see below, you can get working Process by Process control. But most of the properties are supported on windows platform. If you want to access the similar properties on windows mobile, you need to use another function.
using System.Diagnostics;
.
.
.
Process[] prs = Process.GetProcesses();
listBox1.Items.Clear;
foreach( Process pr in prs)
{
listBox1.Items.Add( pr.ProcessName);
}
.
.
.
Process[] prs = Process.GetProcesses();
listBox1.Items.Clear;
foreach( Process pr in prs)
{
listBox1.Items.Add( pr.ProcessName);
}
Another posts included in "C#"
| How to implement switch statement in C# ? (0) | 2009/09/05 |
| How to implement while loop in C# ? (0) | 2009/09/05 |
| How to delete file ? (0) | 2009/09/04 |
| How to convert integer to text string ? (0) | 2009/09/04 |
| How to convert text string to integer ? (0) | 2009/09/04 |
Trackback : Cannot send a trackbact to this post.
switch statement executes a set of logic depending on the value of a given parameter.
The types of the values a switch statement operates on can be booleans, enums, integral types, and strings.
Following is the example.
switch( strName)
{
case "james": strResult="male"; break;
case "jane": strResult="female"; break;
default: strResult = "unkonwn"; break;
}
{
case "james": strResult="male"; break;
case "jane": strResult="female"; break;
default: strResult = "unkonwn"; break;
}
Another posts included in "C#"
| How to get process id in C# like windows task manager ? (0) | 2009/10/15 |
| How to implement while loop in C# ? (0) | 2009/09/05 |
| How to delete file ? (0) | 2009/09/04 |
| How to convert integer to text string ? (0) | 2009/09/04 |
| How to convert text string to integer ? (0) | 2009/09/04 |
| How to set an certain color as transparent color on bitmap (0) | 2009/09/03 |
Trackback : Cannot send a trackbact to this post.
A While Loop will check a condition and then continues to execute a block of code as long as the condition evaluates to a boolean value of true. Its syntax is as follows: while (<boolean expression>) { <statements> }. The statements can be any valid C# statements. The boolean expression is evaluated before any code in the following block has executed. When the boolean expression evaluates to true, the statements will execute. Once the statements have executed, control returns to the beginning of the While Loop to check the boolean expression again.
When the boolean expression evaluates to false, the While Loop statements are skipped and execution begins after the closing brace of that block of code. Before entering the loop, ensure that variables evaluated in the loop condition are set to an initial state. During execution, make sure you update variables associated with the boolean expression so that the loop will end when you want it to. Listing 4-1 shows how to implement a While Loop.
Following is the example.
Another posts included in "C#"
| How to implement switch statement in C# ? (0) | 2009/09/05 |
| How to get process id in C# like windows task manager ? (0) | 2009/10/15 |
| How to delete file ? (0) | 2009/09/04 |
| How to convert integer to text string ? (0) | 2009/09/04 |
| How to convert text string to integer ? (0) | 2009/09/04 |
| How to set an certain color as transparent color on bitmap (0) | 2009/09/03 |
| How to resize and save PNG or Jpeg Image file ? (0) | 2009/09/03 |
Trackback : Cannot send a trackbact to this post.
C# provides file utility as File Class. You don't need to create instance, because it's already created when you declare System.IO on top of your code.
Following is the example to Delete File.
using System.IO;
.
.
.
File.Delete("c:\\_bg.png");
File.Delete("c:\\_gloss.png");
File.Delete("c:\\_outline_shadow.png");
.
.
.
File.Delete("c:\\_bg.png");
File.Delete("c:\\_gloss.png");
File.Delete("c:\\_outline_shadow.png");
Another posts included in "C#"
| How to implement while loop in C# ? (0) | 2009/09/05 |
| How to implement switch statement in C# ? (0) | 2009/09/05 |
| How to get process id in C# like windows task manager ? (0) | 2009/10/15 |
| How to convert integer to text string ? (0) | 2009/09/04 |
| How to convert text string to integer ? (0) | 2009/09/04 |
| How to set an certain color as transparent color on bitmap (0) | 2009/09/03 |
| How to resize and save PNG or Jpeg Image file ? (0) | 2009/09/03 |
| How to display message box in C# (0) | 2009/09/03 |
Trackback : Cannot send a trackbact to this post.
C# provides an excellerent static instance can Convert various types. You can easily get the wanted reult by Convert Class. Because It's a static instance, you don't need to declare instance.
Following is the example to example to Convert from Integer to text string.
Another posts included in "C#"
| How to delete file ? (0) | 2009/09/04 |
| How to implement while loop in C# ? (0) | 2009/09/05 |
| How to implement switch statement in C# ? (0) | 2009/09/05 |
| How to convert text string to integer ? (0) | 2009/09/04 |
| How to set an certain color as transparent color on bitmap (0) | 2009/09/03 |
| How to resize and save PNG or Jpeg Image file ? (0) | 2009/09/03 |
| How to display message box in C# (0) | 2009/09/03 |
| How to convert bitmap image to jpeg image ? (0) | 2009/09/03 |
Prev


Rss Feed