Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with SaveDialogBox/Tecplot

Status
Not open for further replies.

vviti

Programmer
Mar 10, 2005
9
US
Hi, I am trying to supply Tecplot with an input file from within my VB.NET code. However, I am finding that I can run Tecplot just fine through MyProcess but, when I am trying to set the MyProcess.Startinfo.Arguments variable it does not work because of the blanks in the path.

Private Sub btnPlotResults_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlotResults.Click
Dim MyProcess As New System.Diagnostics.Process
MyProcess.StartInfo.CreateNoWindow = True
MyProcess.StartInfo.UseShellExecute = True
'MyProcess.StartInfo.WorkingDirectory = "C:\Documents and Settings\"
MyProcess.StartInfo.FileName = "C:\Program Files\TEC100\Bin\tecplot.exe"
MyProcess.StartInfo.Arguments = strFilename_Tecplot '"C:\Documents and Settings\data.dat"
MyProcess.Start()



So, the problem is that in my string strFilename_Tecplot the whole path of the file I am interested in reading is stored. And this path contains a space as it is "C:\Documents and Settings\data.dat". Tecplot is trying to open up "C:\Documents ". However, if I specify the whole path within quotation marks (as I have commented out above), it works just fine.

Maybe the best way to do this would be to be able to extract just the file name from my string variable strFilename_Tecplot. Is there an easy way to do this? strFilename_Tecplot is set through the save file dialog box:


strFilename = SaveFileDialog1.FileName
strFilename_Tecplot = strFilename


Thanks!
 
try the system.io.path namespace and system.io.filename it has all kinds of usefull filename and path functions. Like seperating path from filename and extension.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Thanks a lot! That was helpful! I could use the get.filename(string) from the system.IO and that did it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top