Registry hex zu string umwandeln

  • VB.NET
  • .NET (FX) 4.0

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von Gonger96.

    Registry hex zu string umwandeln

    Hallo Zusammen ich suche verzweifelt seit Stunden wie ich denn HEX code in einen text String umwandle

    Auslesen kein Problem, der hex code ist dann:
    5C003F003F005C0049004400450023004300640052006F006D004D0041005400530048004900540041005F004400560044002D00520041004D005F0055004A002D003800360030005F005F005F005F005F005F005F005F005F005F005F005F005F005F005F005F005F0052004200300031005F005F005F005F002300350026003300390065006400660031003200660026003000260030002E0030002E00300023007B00350033006600350036003300300064002D0062003600620066002D0031003100640030002D0039003400660032002D003000300061003000630039003100650066006200380062007D00

    so sollte es aussehn danach:
    _??_USBSTOR#Disk&Ven_Y-E_DATA&Prod_MicroSD_Reader&Rev_5.07#000000008742&2#{53f56307-b6bf-11d0-94f2-00a0c91efb8b


    Hier der code um die hex zu erhalten:

    VB.NET-Quellcode

    1. ​Dim value As Object = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices", "\DosDevices\F:", Nothing)
    2. Dim bytes As Byte() = CType(value, Byte())
    3. Dim OutputHEX As String = BitConverter.ToString(bytes)
    4. Dim txt2 As String = Trim(OutputHEX)
    5. While txt2.Contains("-")
    6. txt2 = txt2.Replace("-", "")
    7. End While


    Vielen lieben Dank im Voraus
    Hast du mal Geschaut ob deine erwarteten Daten auch in den Strings stehen?
    Was steht denn am ende in txt2?
    Kommt eine Fehlermeldung?
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    @Gonger96 Jupp, ich hatte auch den abweichenden Text. Daher meine Fragen nach dem Inhalt der Strings
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."