Jump to content

Need some advice

- - - - -

  • Please log in to reply
2 replies to this topic

#1
manuelpeh

manuelpeh

    Newbie

  • Members
  • Pip
  • 4 posts
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
Revolt

Revolt

    Programmer

  • Members
  • PipPipPip
  • 99 posts
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
text = text.Replace("%userName%", manuelpeh)


#3
manuelpeh

manuelpeh

    Newbie

  • Members
  • Pip
  • 4 posts
thanks, supreme answer, work like a charm




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users