Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hex String into number Pin
snorkie20-Jun-08 8:40
professionalsnorkie20-Jun-08 8:40 
GeneralRe: Hex String into number Pin
Brady Kelly20-Jun-08 8:57
Brady Kelly20-Jun-08 8:57 
JokeRe: Hex String into number Pin
Spacix One20-Jun-08 9:23
Spacix One20-Jun-08 9:23 
GeneralRe: Hex String into number Pin
aman200620-Jun-08 8:46
aman200620-Jun-08 8:46 
AnswerRe: Hex String into number Pin
leppie20-Jun-08 8:19
leppie20-Jun-08 8:19 
AnswerRe: Hex String into number Pin
Luc Pattyn20-Jun-08 9:13
sitebuilderLuc Pattyn20-Jun-08 9:13 
AnswerRe: Hex String into number Pin
carbon_golem20-Jun-08 9:16
carbon_golem20-Jun-08 9:16 
AnswerRe: Hex String into number [modified] Pin
Spacix One20-Jun-08 10:11
Spacix One20-Jun-08 10:11 
I'll 1/2 do your homework for ya Wink | ;)
Imports System
Imports System.Globalization
Imports System.Text

Module Module1
    Sub Main()
        Dim sb As New StringBuilder("1C0000")
        Dim str As String
        Dim value As Integer
        Dim bval As Byte
        Dim j As Double

        If (sb.Length Mod 2) = 1 Then
            sb.Append("0")
        End If
        str = sb.ToString()
        For i As Integer = 1 To str.Length Step 2
            j = Math.Pow(16, Convert.ToDouble(i - 1))
            bval = Byte.Parse(Mid(str, i, 2), NumberStyles.HexNumber, NumberFormatInfo.CurrentInfo)
            value += Convert.ToInt32(Convert.ToDouble(bval) * j)
        Next
        Console.WriteLine("The string {0} is equal to {1}", sb.ToString(), value)
    End Sub
End Module
Laugh | :laugh: (doh! fixed logic typo)


-Spacix
All your skynet questions[^] belong to solved

I dislike the black-and-white voting system on questions/answers. Dead | X|

modified on Friday, June 20, 2008 4:25 PM

GeneralRe: Hex String into number Pin
Guffa20-Jun-08 12:55
Guffa20-Jun-08 12:55 
GeneralRe: Hex String into number Pin
Spacix One23-Jun-08 3:37
Spacix One23-Jun-08 3:37 
QuestionSending Text to the Active Control in the Active Application Pin
Dirso20-Jun-08 7:21
Dirso20-Jun-08 7:21 
AnswerRe: Sending Text to the Active Control in the Active Application Pin
DaveyM6920-Jun-08 11:25
professionalDaveyM6920-Jun-08 11:25 
GeneralRe: Sending Text to the Active Control in the Active Application Pin
Dirso20-Jun-08 12:48
Dirso20-Jun-08 12:48 
AnswerRe: Sending Text to the Active Control in the Active Application Pin
mav.northwind20-Jun-08 21:43
mav.northwind20-Jun-08 21:43 
QuestionUpdate Manager Pin
spelltwister20-Jun-08 7:01
spelltwister20-Jun-08 7:01 
AnswerRe: Update Manager Pin
leppie20-Jun-08 7:05
leppie20-Jun-08 7:05 
QuestionHow can we remove specific node in the XML file by LINQ? Pin
Mohammad Dayyan20-Jun-08 6:58
Mohammad Dayyan20-Jun-08 6:58 
AnswerRe: How can we remove specific node in the XML file by LINQ? Pin
leppie20-Jun-08 7:02
leppie20-Jun-08 7:02 
GeneralRe: How can we remove specific node in the XML file by LINQ? Pin
Mohammad Dayyan20-Jun-08 7:20
Mohammad Dayyan20-Jun-08 7:20 
GeneralRe: How can we remove specific node in the XML file by LINQ? Pin
leppie20-Jun-08 8:05
leppie20-Jun-08 8:05 
GeneralRe: How can we remove specific node in the XML file by LINQ? Pin
Mohammad Dayyan20-Jun-08 9:09
Mohammad Dayyan20-Jun-08 9:09 
AnswerRe: How can we remove specific node in the XML file by LINQ? Pin
Mohammad Dayyan20-Jun-08 9:13
Mohammad Dayyan20-Jun-08 9:13 
QuestionPacket issues Pin
see_seA20-Jun-08 5:15
see_seA20-Jun-08 5:15 
AnswerRe: Packet issues Pin
leppie20-Jun-08 5:34
leppie20-Jun-08 5:34 
AnswerRe: Packet issues Pin
leppie20-Jun-08 5:37
leppie20-Jun-08 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.