# How to set path under project folder?

Page 1 of 1

## 3 Replies - 248 Views - Last Post: 04 November 2019 - 08:28 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=417728&amp;s=c51783edb01d82427337fb7022a9b44d&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 aspfun

Reputation: 1
• Posts: 135
• Joined: 16-January 13

# How to set path under project folder?

Posted 04 November 2019 - 06:57 AM

One vb.net project is in d:\myorder\ in which there are references, bin, obj sub-folder.
I created a new folder under myorder project folder and named it as upload.
How to code to copy to upload folder?
The code below did not work because target path is incorrect.

SourceFile = "C:\Users\Owner\Documents\test.txt"
System.IO.File.Copy(SourceFile, TargetFile)


Is This A Good Question/Topic? 0

## Replies To: How to set path under project folder?

### #2 maceysoftware

• Member Title

Reputation: 394
• Posts: 1,648
• Joined: 07-September 13

## Re: How to set path under project folder?

Posted 04 November 2019 - 07:02 AM

Remove the '.\'

Relative paths don't have that, you can have ..\ to tell it to go back up a directory, but no .\ as far as i am aware.

### #3 aspfun

Reputation: 1
• Posts: 135
• Joined: 16-January 13

## Re: How to set path under project folder?

Posted 04 November 2019 - 08:13 AM

maceysoftware, on 04 November 2019 - 07:02 AM, said:

Remove the '.\'

Relative paths don't have that, you can have ..\ to tell it to go back up a directory, but no .\ as far as i am aware.

I tried this but not working as well.
Error message said:

System.IO.DirectoryNotFoundException
HResult=0x80070003
Message=Could not find a part of the path 'upload\bar.jpg'.

 SourceFile = "C:\Users\Owner\Documents\test.txt"
System.IO.File.Copy(SourceFile, TargetFile)


### #4 maceysoftware

• Member Title

Reputation: 394
• Posts: 1,648
• Joined: 07-September 13

## Re: How to set path under project folder?

Posted 04 November 2019 - 08:28 AM

Yeah didn't think it was going to work.

Instead of trying to use a relative path, how about using a absolute path?