Home » Archive by category "Applications" (Page 3)

Archive for the 'Applications' Category

Delete old images – VB Script

Copy this code into notepad and save as DeleteOldImages.vbs ‘******************* Start of Code ************************* Option Explicit On Error Resume Next Dim oFSO, oFolder, sDirectoryPath Dim oFileCollection, oFile, sDir Dim iDaysOld ‘ Specify Directory Path From Where You want to clear the old files sDirectoryPath = “C:\Users\mike\Desktop\Test” ‘ Specify Number of Days Old File to Delete […]

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 […]