Re: IsNumeric
- From: wawang@xxxxxxxxxxxxxxxxxxxx (Walter Wang [MSFT])
- Date: Mon, 04 Sep 2006 01:54:18 GMT
Hi sck10,
Thank you for your quick reply.
Here's the steps to get the source code of IsNumeric:
1) Create a simple VB.NET console application, type in following code:
Sub Main()
Dim s As String = "1.234"
If IsNumeric(s) Then
Console.WriteLine("s is numeric")
End If
s = "2006/9/1"
If IsDate(s) Then
Console.WriteLine("s is date")
End If
End Sub
2) Build it; in Reflector, open the generated exe; find the Main function,
double click it to see its disassembled code (make sure you selected "C#"
in the toolbar combobox):
[STAThread]
public static void Main()
{
string text1 = "1.234";
if (Versioned.IsNumeric(text1))
{
Console.WriteLine("s is numeric");
}
text1 = "2006/9/1";
if (Information.IsDate(text1))
{
Console.WriteLine("s is date");
}
}
3) Click on the "IsNumeric" function to navigate to its source. You will
learn that it's located in Microsoft.VisualBasic.CompilerServices.Versioned
as a static method, so you can reference Microsoft.VisualBasic.dll in your
C# project and use this method directly; or you can write your version of
IsNumeric use the disassembled code as reference.
Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: IsNumeric
- From: sck10
- Re: IsNumeric
- From: Walter Wang [MSFT]
- Re: IsNumeric
- References:
- IsNumeric
- From: sck10
- RE: IsNumeric
- From: Walter Wang [MSFT]
- Re: IsNumeric
- From: sck10
- IsNumeric
- Prev by Date: Re: IsNumeric
- Next by Date: Re: IsNumeric
- Previous by thread: Re: IsNumeric
- Next by thread: Re: IsNumeric
- Index(es):
Relevant Pages
|