user2567230
user2567230

Reputation: 27

Append Textbox value to a string

In my code

 oOutputFile.FileName = "F:\inventor\Proof Of Con\Rim\Document\Rim_Update.dwf

I want to add textbox1 value to the end of the file name.here my textbox1 value is 100.Then the output will look like

Rim_Update100.dwf

how can I add this

Upvotes: 0

Views: 584

Answers (2)

Tobia Zambon
Tobia Zambon

Reputation: 7619

You can use the Path class of System.IO to manipulate paths:

  System.IO.Path.GetFileNameWithoutExtension(oOutputFile.FileName) + 
          textbox1.Text + 
          System.IO.Path.GetExtension(oOutputFile.FileName)

Upvotes: 6

Andrey Gordeev
Andrey Gordeev

Reputation: 32449

oOutputFile.FileName = "F:\inventor\Proof Of Con\Rim\Document\Rim_Update" & textbox1.Value & ".dwf"

Upvotes: 1

Related Questions