cant write file to hard disk in vb.net -
hi checked questions present here did not helped me asked
ok here go
i try copy file "resources" "c:\test" folder not work me
here tried:
firstly, put test.txt file in resources copy "c:\test" folder error
imports system.io public class form1 private sub button1_click(sender object, e eventargs) handles button1.click io.file.writeallbytes("c:\test", my.resources.test) end sub end class
i error cant debug
error :- error 1 value of type 'string' cannot converted '1-dimensional array of byte'.
so there way can copy .txt file "c:\test" folder if exist can copy replace ?
now changed extension of test.txt test.bin
it allows me start program in debug , no error code;
imports system.io public class form1 private sub button1_click(sender object, e eventargs) handles button1.click io.file.writeallbytes("c:\test", my.resources.test) end sub end class
now when click button1 error
see end of message details on invoking just-in-time (jit) debugging instead of dialog box.
************** exception text **************
system.unauthorizedaccessexception: access path 'c:\test' denied.
so want copy file , replace if present there suppose file test.txt , test.bin both cases
now code work can copy file resources "c:\test" folder
and yes run admin still error access denied in second 1 ?
im noob im beginner in vb.net alot if u cud me :)
you need specify filename in path. , also, need convert file resource bytes array. because that's writeallbytes()
function expecting
do search in google.
Comments
Post a Comment