Get location outside of website folder

webRootPath = Server.MapPath(“~”);

docPath = Path.GetFullPath(Path.Combine(webRootPath, “..\Documents\MyDocument.xml”));

Anuncios

Delete from FTP

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpPath);

request.Credentials = new NetworkCredential(user, pass);

request.Method = WebRequestMethods.Ftp.DeleteFile;

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

response.Close();

Open web in new tab

Page.ClientScript.RegisterStartupScript(this.GetType(), “OpenWindow”, “window.open(‘http://www.google.com’, ‘_newtab’);”, true);

Install ASP.NET in IIS

  1. Open IIS Manager, or search “inetmgr” from Run
  2. Click Web Service Extensions
  3. Allow ASP.NET