Guys, Have a look...

File.Delete("C:\\hi.txt");

This function is used for deleting a specific file right? But I m unable to delete it?
Is there my little mistake?

Recommended Answers

All 13 Replies

If you're using Vista or W7 you may need to give your application administrator privileges to modify something in the root directory like that.

how to make that?pseudorandom21

don't place files in your root directory try to create a separate folder for placing the files or place them in you project folder.. Or use any other directory instead

Any alternative or how to delete or give permission to delete a file?

abelazm do u know how to give permission? to allow delete file...as I m stucked in giving permission to delete a file.

Member Avatar for saravind84

Place the file to be deleted in a folder. Give all users full control to that folder. This will solve the issue.

Sorry, I m newbie in asp.net..how to give full control to all users?who users are these?I try put ASPNET.But it doesnt work.

check this link may be helpful for giving permissions

any other method guys?

Erm , I m able to solve already. When I put the code above response.end();..
any 1 know why?

i never heard this ex. file.delete

This is not extension.This is a function File.Delete()..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.