Home » 2013 » March

Archive for March, 2013

HTTP – HTTPS Redirect

VB code If Not Request.IsLocal AndAlso Not Request.IsSecureConnection Then Dim redirectUrl As String = Request.Url.ToString().Replace(“http:”, “https:”) Response.Redirect(redirectUrl) End If C# code if (!Request.IsLocal && !Request.IsSecureConnection) { string redirectUrl = Request.Url.ToString().Replace(“http:”, “https:”); Response.Redirect(redirectUrl); } Classic asp Read more… ‘do https stuff dim httpsStuff httpsStuff = Request.ServerVariables(“PATH_INFO”) if Request.ServerVariables(“QUERY_STRING”) “” then httpsStuff = httpsStuff & “?” & […]

Read the content of the folder – VB.NET

<%@ Page Language=”VB” %> <%@ Import Namespace=”System” %> <%@ Import Namespace=”System.IO” %> <%@ Import Namespace=”System.IO.FileInfo” %> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <style type=”text/css”> ul { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 25px; font-variant: normal; color: #0C4F93; text-indent: 5px; list-style-position: outside; list-style-type: square; } <script runat=”server”> Protected Sub Page_Load(ByVal […]