visual studio 2010 - GetFullPath no output ?! VB.NET -


good evening of you! have problem can't solve method getfullpath in vb.net.

what want :

i full path of text file (test.txt) located in same folder app.exe, 1 working on. need full path use other method. know more reason doesn't work, put getfullpath output in msgbox.

what happening :

the msgbox shows blank. strange because, if test.txt doesn't exist, output should exist (as if file exists). warning : in case file exists

documentation : https://msdn.microsoft.com/en-us/library/system.io.path.getfullpath(v=vs.100).aspx cf. "remarks"

what think :

is possible app.exe doesn't see test.txt in same folder ? don't think so, give outpout. maybe problem of permission ? don't know why msgbox empty.

my peace of code :

dim file1 string = "test.txt" msgbox(getfullpath(file1))

thankyou try me. have nice day ! :)
please excuse poor english. microsoft visual studio 2010.

it appears in code changing working directory (or in case of windows xp, not being set properly). getfullpath function have provided below return path believe expecting regardless of working directory.

private sub button1_click(sender object, e eventargs) handles button1.click     messagebox.show(getfullpath("file.txt")) end sub  private function getfullpath(filename string) string     return io.path.combine(application.startuppath, filename) end function 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -