Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

40,023 questions

51,974 answers

573 users

How to convert hex string to an integer in C#

3 Answers

0 votes
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string hex = "0003FE0A";
                int n = int.Parse(hex, System.Globalization.NumberStyles.HexNumber);
                Console.WriteLine(n);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}

/*
run:
 
261642

*/


answered Mar 24, 2015 by avibootz
0 votes
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string hex = "0003FE0A";
                int n = Convert.ToInt32(hex, 16);
                Console.WriteLine(n);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}

/*
run:
 
261642

*/


answered Mar 24, 2015 by avibootz
0 votes
using System;
using System.Globalization;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string hex = "0003FE0A";
                int n = int.Parse(hex, NumberStyles.HexNumber);
                Console.WriteLine(n);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}

/*
run:
 
261642

*/


answered Mar 24, 2015 by avibootz

Related questions

1 answer 167 views
1 answer 247 views
1 answer 88 views
1 answer 62 views
62 views asked Nov 19, 2024 by avibootz
1 answer 99 views
2 answers 130 views
1 answer 213 views
213 views asked Mar 24, 2015 by avibootz
...