ASP.NET(vb.net) & Delete File - The in this tutorial, you’ll learn and example scripts how to Delete text file using by ASP.NET scripts.
ShotDev Focus:
- ASP.NET(vb.net) & Delete File
Example
AspNetDeleteFile.aspx
<%@ Import Namespace="System.IO"%> <%@ Page Language="VB" %> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) Dim FileIn As New FileInfo(Server.MapPath("MyFiles/shotdev.txt")) If FileIn.Exists Then FileIn.Delete() Me.lblText.Text = "Files Deleted." Else Me.lblText.Text = "Files Not Delete." End If End Sub </script> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <form runat="server"> <asp:Label id="lblText" runat="server"></asp:Label><br /> </form> </body> </html>
Screenshot