user827665
user827665

Reputation:

Replace variables inside txt file programatically from vb.net

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?

Upvotes: 0

Views: 1107

Answers (1)

Magnus
Magnus

Reputation: 46909

TextBox1.Text = TextBox1.Text.Replace("%userName%", TextBox2.Text)

Upvotes: 2

Related Questions