Skip to content

Instantly share code, notes, and snippets.

View constructor-igor's full-sized avatar

Igor Ziselman constructor-igor

View GitHub Profile
@constructor-igor
constructor-igor / sending-email-via-Outlook-sample
Created November 24, 2014 13:21
Sending email via Outlook (powershell)
$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0)
$Mail.To = "[email protected]"
$Mail.Subject = "Action"
$Mail.Body ="Pay rise please"
$Mail.Send()
@constructor-igor
constructor-igor / gist:7746536
Last active December 29, 2015 23:59
how to open folder in Windows Explorer
Process.Start("explorer.exe", "/select," + <folder>);
@constructor-igor
constructor-igor / gist:7578986
Created November 21, 2013 10:02
Get DLL names from running process, possible?
Process[] processes = Process.GetProcesses();
foreach(Process process in processes) {
Console.WriteLine("PID: " + process.Id);
Console.WriteLine("Name: " + process.Name);
Console.WriteLine("Modules:");
foreach(ProcessModule module in process.Modules) {
Console.WriteLine(module.FileName);
}
@constructor-igor
constructor-igor / gist:7412423
Created November 11, 2013 12:24
how to copy directory
private static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs)
{
// Get the subdirectories for the specified directory.
DirectoryInfo dir = new DirectoryInfo(sourceDirName);
DirectoryInfo[] dirs = dir.GetDirectories();
if (!dir.Exists)
{
throw new DirectoryNotFoundException(
"Source directory does not exist or could not be found: "
@constructor-igor
constructor-igor / gist:7397076
Created November 10, 2013 11:30
how to get executable version
public static string Version
{
get
{
Assembly asm = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);
return String.Format("{0}.{1}.{2}.{3}", fvi.ProductMajorPart, fvi.ProductMinorPart, fvi.ProductBuildPart, fvi.ProductPrivatePart);
}
}