Click here to Skip to main content
15,925,400 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can i access (parallel or serial ports) in C# Pin
Judah Gabriel Himango5-Jul-05 4:52
sponsorJudah Gabriel Himango5-Jul-05 4:52 
QuestionValidation ...How to do? Pin
just4ulove75-Jul-05 3:00
just4ulove75-Jul-05 3:00 
Generalproperty creation Pin
deep75-Jul-05 1:56
deep75-Jul-05 1:56 
GeneralRe: property creation Pin
MoustafaS5-Jul-05 2:39
MoustafaS5-Jul-05 2:39 
GeneralRe: property creation Pin
deep75-Jul-05 20:18
deep75-Jul-05 20:18 
GeneralRe: property creation Pin
deep75-Jul-05 20:18
deep75-Jul-05 20:18 
Generalhelp me plz Pin
romantic boy5-Jul-05 1:48
romantic boy5-Jul-05 1:48 
GeneralRe: help me plz Pin
Nikhil mandalia5-Jul-05 2:11
Nikhil mandalia5-Jul-05 2:11 
[C#]
// Sample for the Convert class summary.
using System;

class Sample
{
public static void Main()
{
string nl = Environment.NewLine;
string str = "{0}Return the Int64 equivalent of the following base types:{0}";
bool xBool = false;
short xShort = 1;
int xInt = 2;
long xLong = 3;
float xSingle = 4.0f;
double xDouble = 5.0;
decimal xDecimal = 6.0m;
string xString = "7";
char xChar = '8'; // '8' = hexadecimal 38 = decimal 56
byte xByte = 9;

// The following types are not CLS-compliant.
ushort xUshort = 120;
uint xUint = 121;
ulong xUlong = 122;
sbyte xSbyte = 123;

// The following type cannot be converted to an Int64.
// DateTime xDateTime = DateTime.Now;

Console.WriteLine(str, nl);
Console.WriteLine("Boolean: {0}", Convert.ToInt64(xBool));
Console.WriteLine("Int16: {0}", Convert.ToInt64(xShort));
Console.WriteLine("Int32: {0}", Convert.ToInt64(xInt));
Console.WriteLine("Int64: {0}", Convert.ToInt64(xLong));
Console.WriteLine("Single: {0}", Convert.ToInt64(xSingle));
Console.WriteLine("Double: {0}", Convert.ToInt64(xDouble));
Console.WriteLine("Decimal: {0}", Convert.ToInt64(xDecimal));
Console.WriteLine("String: {0}", Convert.ToInt64(xString));
Console.WriteLine("Char: {0}", Convert.ToInt64(xChar));
Console.WriteLine("Byte: {0}", Convert.ToInt64(xByte));
Console.WriteLine("DateTime: There is no example of this conversion because");
Console.WriteLine(" a DateTime cannot be converted to an Int64.");
//
Console.WriteLine("{0}The following types are not CLS-compliant.{0}", nl);
Console.WriteLine("UInt16: {0}", Convert.ToInt64(xUshort));
Console.WriteLine("UInt32: {0}", Convert.ToInt64(xUint));
Console.WriteLine("UInt64: {0}", Convert.ToInt64(xUlong));
Console.WriteLine("SByte: {0}", Convert.ToInt64(xSbyte));
}
}
/*
This example produces the following results:

Return the Int64 equivalent of the following base types:

Boolean: 0
Int16: 1
Int32: 2
Int64: 3
Single: 4
Double: 5
Decimal: 6
String: 7
Char: 56
Byte: 9
DateTime: There is no example of this conversion because
a DateTime cannot be converted to an Int64.

The following types are not CLS-compliant.

UInt16: 120
UInt32: 121
UInt64: 122
SByte: 123
*/



Nikhil mandalia
Software engineer.
GeneralRe: help me plz Pin
romantic boy5-Jul-05 3:16
romantic boy5-Jul-05 3:16 
GeneralRe: help me plz Pin
romantic boy5-Jul-05 5:04
romantic boy5-Jul-05 5:04 
GeneralRe: help me plz Pin
romantic boy5-Jul-05 9:26
romantic boy5-Jul-05 9:26 
Questionalpha? Pin
kopi_b5-Jul-05 1:33
kopi_b5-Jul-05 1:33 
AnswerRe: alpha? Pin
Judah Gabriel Himango5-Jul-05 4:54
sponsorJudah Gabriel Himango5-Jul-05 4:54 
GeneralWindows Forms MDI C# One ParentForm and a lot of ChildrenForms Pin
Brunelleschi5-Jul-05 1:01
Brunelleschi5-Jul-05 1:01 
GeneralRe: Windows Forms MDI C# One ParentForm and a lot of ChildrenForms Pin
Judah Gabriel Himango5-Jul-05 9:40
sponsorJudah Gabriel Himango5-Jul-05 9:40 
GeneralMaximize a form on dual screen Pin
Boltmelots5-Jul-05 0:49
Boltmelots5-Jul-05 0:49 
GeneralRe: Maximize a form on dual screen Pin
Guffa5-Jul-05 4:02
Guffa5-Jul-05 4:02 
GeneralGrading MultipleQuestions Exams System Pin
mhmo5-Jul-05 0:29
mhmo5-Jul-05 0:29 
GeneralRe: Grading MultipleQuestions Exams System Pin
LongRange.Shooter6-Jul-05 9:59
LongRange.Shooter6-Jul-05 9:59 
GeneralCross-thread events Pin
1nsp1r3d5-Jul-05 0:21
1nsp1r3d5-Jul-05 0:21 
GeneralRe: Cross-thread events Pin
Judah Gabriel Himango5-Jul-05 4:46
sponsorJudah Gabriel Himango5-Jul-05 4:46 
GeneralRe: Cross-thread events Pin
1nsp1r3d5-Jul-05 7:09
1nsp1r3d5-Jul-05 7:09 
GeneralRe: Cross-thread events Pin
Judah Gabriel Himango5-Jul-05 9:35
sponsorJudah Gabriel Himango5-Jul-05 9:35 
QuestionHow do i add an item to a combo box? Pin
Anthony Mushrow5-Jul-05 0:13
professionalAnthony Mushrow5-Jul-05 0:13 
AnswerRe: How do i add an item to a combo box? Pin
Christian Graus5-Jul-05 0:18
protectorChristian Graus5-Jul-05 0:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.