|
-
Feb 28th, 2006, 04:53 PM
#14
Re: Using VB 6 functions in .net
As an aside, Double.TryParse was originally created because IsNumeric had the same issue that you are experiencing with IsDate. IsNumeric was reimplemented to use Double.TryParse, so I'd guess that in .NET 2.0 IsDate has been reimplemented to use Date.TryParse. That still doesn't mean that it's a good idea to use the Runtime functions. You lose nothing if you don't need to keep the parsed value but if you do then you'll end up parsing it twice; once in the IsNumeric or IsDate function to check whether it's valid, then again to actually get the value.
I guess what you could do is use a tool to look inside the Date.TryParse method and then create your own method that works the same way in .NET 1.1. I've never used it but I believe that Reflector is a useful tool for this. You may also like to get some of the other useful tools from that page.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|