I have some issues trying to make a thing, if any 1 here can give me an advice or some help will be nice.
I need to read some information from a txt file and put all that info to a textbox, this is ready and done.
but the textfile have some variables like %userName% that i need to replace programatically in vb.net, any 1 have an idea how to do it?
example of text file:
hello %userName% , this is an automated report of the uses of your account.
this is what the txt file have in it, when i read it to vb.net and put that info into a textbox is done right, but the question is how to replace the %userNams% for some text in another textbox and replaced when i press a button?
2 replies to this topic
#1
Posted 10 July 2011 - 02:45 PM
|
|
|
#2
Posted 10 July 2011 - 03:09 PM
You can achieve that with string replace: String.Replace Method (System)
Assuming text is the string variable that contains the text read from the file you can do
Assuming text is the string variable that contains the text read from the file you can do
text = text.Replace("%userName%", manuelpeh)
#3
Posted 10 July 2011 - 03:43 PM
thanks, supreme answer, work like a charm
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









