I write the code below to delete a file:
FileInfo file = new FileInfo(filename);
file.Delete(Path);
but I am getting the error that file.Delete(path) takes 1 argument please help me
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are creating an instance of FileInfo having a filename as an arguement.
Method file.Delete() will remove the file which you passed through a constructor.
In fact, the argument of constructor must be an absolute path along with filename.