How to delete a file from the server?

VB.NET System.IO.File.Delete(Server.MapPath('wnew.txt')) C# System.IO.File.Delete(Server.MapPath('wnew.txt')) Make sure that you have permissions to delete a file.

How to get URL without querystring

VB.NET Dim stringUri As String = 'http://www.syncfusion.com/?id=1&auid=16' Dim weburi As Uri = New Uri(stringUri) Dim query As String = weburi.Query Dim weburl As String = stringUri.Substring(0, stringUri.Length - query.Length) Response.Write(weburl) C# string stringUri = 'http://www.syncfusion.com/?id=1&auid=16'; Uri weburi = new Uri(stringUri); string query = weburi.Query; string weburl = stringUri.Substring(0, stringUri.Length - query.Length); Response.Write (weburl);