Click here to Skip to main content
15,889,574 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to hook up event of winform-based control hosting in IE Pin
EricHu25-Aug-04 13:28
EricHu25-Aug-04 13:28 
GeneralRe: how to hook up event of winform-based control hosting in IE Pin
Heath Stewart26-Aug-04 6:50
protectorHeath Stewart26-Aug-04 6:50 
Generalplay a movie Pin
kornstyle25-Aug-04 4:25
kornstyle25-Aug-04 4:25 
GeneralRe: play a movie Pin
Nick Parker25-Aug-04 5:31
protectorNick Parker25-Aug-04 5:31 
GeneralRe: play a movie Pin
kornstyle25-Aug-04 5:56
kornstyle25-Aug-04 5:56 
GeneralConvert vs parse Pin
Not Active25-Aug-04 3:27
mentorNot Active25-Aug-04 3:27 
GeneralRe: Convert vs parse Pin
LongRange.Shooter25-Aug-04 4:13
LongRange.Shooter25-Aug-04 4:13 
GeneralRe: Convert vs parse Pin
Norman-Timo25-Aug-04 4:20
Norman-Timo25-Aug-04 4:20 
Hi!

I don´t know the exactly function of both methods, but there is one big difference.

I can´t explain it in words, just try following code:


using System;
using System.Globalization;

namespace DummyTest
{
///
/// Summary description for Class2.
///

public class Class2
{
[STAThread]
static void Main()
{
string test = "2,5";

try
{
double i = Convert.ToDouble(test);
Console.WriteLine(i);
double a = double.Parse(test, NumberStyles.Float);
Console.WriteLine(a);
}
catch (Exception err)
{
Console.WriteLine("Exception: ", err.Message);
}
}
Console.Readline();
}
}



So you can see, the Convert method try to convert equal what he gets, and with the parse method you are able to specify the input format.

Certainly there are more pro´s and con´s but I only know this one...

Norman-Timo
GeneralRe: Convert vs parse Pin
Charlie Williams25-Aug-04 4:53
Charlie Williams25-Aug-04 4:53 
GeneralRe: Convert vs parse Pin
Nick Parker25-Aug-04 5:20
protectorNick Parker25-Aug-04 5:20 
GeneralRe: Convert vs parse Pin
Not Active25-Aug-04 6:00
mentorNot Active25-Aug-04 6:00 
GeneralClass field initialisation question. Pin
Dr Herbie25-Aug-04 3:21
Dr Herbie25-Aug-04 3:21 
GeneralRe: Class field initialisation question. Pin
Norman-Timo25-Aug-04 3:29
Norman-Timo25-Aug-04 3:29 
GeneralRe: Class field initialisation question. Pin
Not Active25-Aug-04 3:34
mentorNot Active25-Aug-04 3:34 
GeneralRe: Class field initialisation question. Pin
leppie25-Aug-04 5:09
leppie25-Aug-04 5:09 
GeneralRe: Class field initialisation question. Pin
Nick Parker25-Aug-04 5:26
protectorNick Parker25-Aug-04 5:26 
GeneralRe: Class field initialisation question. Pin
Heath Stewart25-Aug-04 9:27
protectorHeath Stewart25-Aug-04 9:27 
GeneralThank You Pin
Dr Herbie25-Aug-04 22:08
Dr Herbie25-Aug-04 22:08 
GeneralExcel 2003 Custom Toolbar Flickers when any VBA Macro runs in the Excel Contest Pin
kellap25-Aug-04 1:54
kellap25-Aug-04 1:54 
GeneralOffice Excel 2003 with Information Bridge Framwork Pin
kellap25-Aug-04 1:50
kellap25-Aug-04 1:50 
GeneralRe: Office Excel 2003 with Information Bridge Framwork Pin
Heath Stewart25-Aug-04 9:33
protectorHeath Stewart25-Aug-04 9:33 
GeneralException in web services Pin
Diego F.25-Aug-04 0:18
Diego F.25-Aug-04 0:18 
GeneralRe: Exception in web services Pin
Salil Khedkar25-Aug-04 2:54
Salil Khedkar25-Aug-04 2:54 
GeneralRe: Exception in web services Pin
Salil Khedkar25-Aug-04 2:59
Salil Khedkar25-Aug-04 2:59 
GeneralRe: Exception in web services Pin
Nick Parker25-Aug-04 5:37
protectorNick Parker25-Aug-04 5:37 

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.