Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# how to delete a file

File.Delete(@"C:TempDataAuthors.txt");
Comment

How to delete File in c#

string gpath;

        string path=@"c:UsersAdamDesktop";

        string name="file";

        string f="";

        int i=0;

        string ext=".txt";

        while(File.Exists(path + name + f + ext))
        {
            i++;

            f = i.ToString();
        }

        gpath = path + name + f + ext;

        button2.Enabled = true;

        File.Create(gpath);

        File.Delete(gpath);//why there is an Error??
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# is file closed 
Csharp :: c# order of initialization 
Csharp :: blazor navlink change bg of current component 
Csharp :: .net new template 
Csharp :: flutter find a widget 
Csharp :: unittest servicector automapper 
Csharp :: blazor data annotation diaply name 
Csharp :: open html file in browser using c++ 
Csharp :: visibility bound to radio button wpf 
Csharp :: c# message box carriage return 
Csharp :: get c directory contains system windows c# 
Csharp :: c# rotate sum array 
Csharp :: c# increment by 2 
Csharp :: show a message box in c# 
Csharp :: unity check if object is being rendered 
Csharp :: in clause db2 c# 
Csharp :: c# void with nullable List argument 
Csharp :: remote webdriver dotnet 
Csharp :: unity dictionary foreach remove 
Csharp :: NetConnectionDispatch 
Csharp :: reflection static method c# 
Csharp :: simplified if statement c# 
Csharp :: c# try catch multiple catches 
Csharp :: c# interoperability with linux or bash script 
Csharp :: c# get hwid 
Csharp :: EntityFramework: using tables in different scemas 
Csharp :: unity how to have multiple headers 
Csharp :: unity set terrain to image 
Csharp :: can a dictionary type use get set c# 
Csharp :: change character velocity unity 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =