Skip to content

Instantly share code, notes, and snippets.

@tekguy
tekguy / MyCompanySiteMapVisibilityProvider.cs
Last active January 2, 2016 17:49
Visiblity Provider for MVCSiteMapProvider 4.0
namespace MyCompany.Web
{
public class MyCompanySiteMapVisibilityProvider : MvcSiteMapProvider.SiteMapNodeVisibilityProviderBase
{
public override bool IsVisible(ISiteMapNode node, IDictionary<string, object> sourceMetadata)
{
if (node == null)
{
return true;
}
@tekguy
tekguy / DeleteOldBackups.vbs
Last active December 18, 2015 11:39
VBScript to delete old .bak files from specified directory
'==============================
'Remove old backups
'http://gordondurgha.com
'=============================
'Definitions
iDaysOld = 3
strExtension = ".bak"
sDirectoryPath = "D:\MSSQL\Backups\"
@tekguy
tekguy / KoograRead.cs
Last active June 30, 2020 07:13
Read an excel file using Koogra
// This example shows how to read and excel file using the Koogra library (http://sourceforge.net/projects/koogra/)
// Supports .xls and .xlsx example
public static string ReadExcelContent(string filePath)
{
uint rowNum = 0;
uint colNum = 0;
var data = new StringBuilder();
try
{