• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

How to convert a string to a unsigned long number in C#?

Want to convert a string to a big number. For example, want to achieve
 I got the error:
"error CS0103: The name 'ToULong' does not exist in the current context"
4 Solutions
AndyAinscowFreelance programmer / ConsultantCommented:
           ulong ul = Convert.ToUInt64("1234567890");
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
Alternative to ToULong is ToUInt64. Try it.
AndyAinscowFreelance programmer / ConsultantCommented:
Isn't that what I said?
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Carl TawnSystems and Integration DeveloperCommented:
Alternative, albeit it only semantic since they both do the same thing:
ulong ul = ulong.Parse("1234567890");

Open in new window

And with tryparse..

Best regards.
ulong number;
if(ulong.TryParse("33535355353", out number){
// Do stuf

Open in new window

jl66Author Commented:
Really appreciated everyone's tips.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now