Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27508

VS 2008 Cannot change text in a string with value of a string array from memory

$
0
0
Hi,
i have a little problem, i am doing a application that takes the username stored as string array in process memory and i have a little problem. This string array contains Environment.Username (windows username) and i can change it, but its also containing few other things but i cant change them.
Well doing it like this:
Code:

If string.Contains(Environment.Username) Then
      string = string.Replace(Environment.Username, "MyText")
End If

works, but doing it like this:
(even if Environment.Username is "silentus")
Code:

string = string.Replace("silentus", "MyText")
Does completely nothing, when showing the string in a label/msgbox its still the same, with original username.

Why it happens and how can i fix it ? Same happens when i try to do:
Code:

string = string + "MyText"
This is how iam getting the value from memory:
Code:

Dim byteValue As Byte() = ReadMemory(&HAddy, 150) 'Process name is set in the module, not here


        Dim strValue As String = System.Text.ASCIIEncoding.ASCII.GetString(byteValue, 0, byteValue.Length - 1)
        System.Text.RegularExpressions.Regex.Replace(strValue, "[^\w\s\p{P}]", "")
        Dim final As String = strValue


Viewing all articles
Browse latest Browse all 27508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>