Thursday, 15 January 2015

vb.net - String to Array to Registry -



vb.net - String to Array to Registry -

i have string:

46-c9-08-b6-e8-f3-47-cf-53-2a-77-02-c9-19-7f

i want create array looks this:

{&h46, &hc9, &h8, &hb6, &he8, &hf3, &h47, &hcf, &h53, &h2a, &h77, &h2, &hc9, &h19, &h7f}

the finished line so:

my.computer.registry.setvalue("hkey_local_machine\software\wow6432node\bohemia interactive studio\arma 2 oa", "key", new byte() {&h46, &hc9, &h8, &hb6, &he8, &hf3, &h47, &hcf, &h53, &h2a, &h77, &h2, &hc9, &h19, &h7f}, registryvaluekind.binary)

it inserted registry reg_binary type.

dim s string= "46-c9-08-b6-e8-f3-47-cf-53-2a-77-02-c9-19-7f" dim parts string() = s.split(new char() {"-"}) dim bytearray(parts.length - 1) byte integer = 0 parts.length - 1 bytearray(i) = convert.tobyte(parts(i), 16) next

arrays vb.net string regedit

No comments:

Post a Comment