IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
  Reply to this topicStart new topicStart Poll

 Visual basic 2010 help

 Copying a file
 
The_Sorrow  
Posted: Friday, Dec 9 2011, 17:43
Quote Post


Heaven, I'm in heaven(8)
Group Icon
Group: Members
Joined: May 31, 2010

en.gif

XXXXX



CODE

Dim attribute As System.IO.FileAttributes = IO.FileAccess.ReadWrite
System.IO.File.SetAttributes(safold.SelectedPath, attribute)
System.IO.File.Copy(safold.SelectedPath, ListBox1.Items.Item(0), True)
MsgBox("Files copied")


Okay, im trying to copy a file to a folder (safold.selectedpath) and i keep getting a "Access to path [safold's path] denied" as you can see im even editing the files attributes to read and write and i still get this error, the selected path isnt read only either, so whats causing this problem?
Users WebsitePMMSN
  Top
 

 
K^2  
Posted: Friday, Dec 9 2011, 20:50
Quote Post


Vidi Vici Veni
Group Icon
Group: Zaibatsu
Joined: Apr 14, 2004

us.gif

Member Award




Two possible causes I can think of. First, the path to copy the file to must contain the file name. It shouldn't be just a path to a folder to which you're copying. Second, if the file exists, File.Copy won't overwrite by default. To allow overwrite, you must call File.Copy(path_to, path_from, True).
PMMSN
  Top
 

 
OzzySM12  
Posted: Saturday, Dec 10 2011, 01:02
Quote Post


Hmm...
Group Icon
Group: Members
Joined: Nov 7, 2004

sj.gif

XXXXX



If the files are in system folders such as "Program Files" or "Windows" you may need to run your program as administrator.
Users WebsitePMXbox Live
  Top
 

 
The_Sorrow  
Posted: Saturday, Dec 10 2011, 16:46
Quote Post


Heaven, I'm in heaven(8)
Group Icon
Group: Members
Joined: May 31, 2010

en.gif

XXXXX



Thanks for the reply dudes, given up on Visual basic as its a time waster icon13.gif
Started to learn c++ using "cprogramming.com"

Im currently using codeblocks as my debugger, cause vc++ is too complicated for me suicidal.gif
Users WebsitePMMSN
  Top
 

 
Swoorup  
Posted: Sunday, Dec 11 2011, 16:21
Quote Post


innovator
Group Icon
Group: Members
Joined: Oct 28, 2008

au.gif

XXXXX



VB is still a fast way to make Window based apps. smile.gif
And I think you meant to say Codeblocks as IDE ( Integrated Development Environment) ?
PMMSNYahoo
  Top
 

 
nightwalker83  
Posted: Tuesday, Dec 13 2011, 06:02
Quote Post


Don't mind me
Group Icon
Group: Members
Joined: Oct 10, 2004

au.gif

XXXXX



QUOTE (The_Sorrow @ Sunday, Dec 11 2011, 03:16)
Thanks for the reply dudes, given up on Visual basic as its a time waster icon13.gif
Started to learn c++ using "cprogramming.com"

Im currently using codeblocks as my debugger, cause vc++ is too complicated for me suicidal.gif

How are you finding C++?
Users WebsitePMMSN
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG