This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void LoadBitmapFromStream() | |
{ | |
System.Drawing.Image bmp = System.Drawing.Bitmap.FromFile(@"C:\Temp\test.png"); | |
MemoryStream strm = new MemoryStream(); | |
bmp.Save(strm, System.Drawing.Imaging.ImageFormat.Bmp); | |
strm.Position = 0; | |
System.Drawing.Image img = System.Drawing.Image.FromStream(strm); | |
BitmapImage bi = new BitmapImage(); | |
bi.BeginInit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static public void Main () | |
{ | |
FileStream ostrm; | |
StreamWriter writer; | |
TextWriter oldOut = Console.Out; | |
try | |
{ | |
ostrm = new FileStream ("./Redirect.txt", FileMode.OpenOrCreate, FileAccess.Write); | |
writer = new StreamWriter (ostrm); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Linq; | |
namespace CheckZipToString | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WebUtils | |
{ | |
private static Lazy<IWebProxy> proxy | |
= new Lazy<IWebProxy>(() => string.IsNullOrEmpty(Settings.Default.WebProxyAddress) ? null : | |
new WebProxy { Address = new Uri(Settings.Default.WebProxyAddress), UseDefaultCredentials = true }); | |
public static IWebProxy Proxy | |
{ | |
get { return WebUtils.proxy.Value; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
List<string> arrHeaders = new List<string>(); | |
Shell32.Shell shell = new Shell32.Shell(); | |
Shell32.Folder objFolder; | |
objFolder = shell.NameSpace(@"C:\temp\testprop"); | |
for( int i = 0; i < short.MaxValue; i++ ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Combine(WorkRng As Range, Optional Sign As String = ",") As String | |
Dim Rng As Range | |
Dim OutStr As String | |
For Each Rng In WorkRng | |
If Rng.Text <> "," Then | |
OutStr = OutStr & Rng.Text & Sign | |
End If | |
Next | |
Combine = Left(OutStr, Len(OutStr) - 1) | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*******Interrupt-based Rotary Encoder Sketch******* | |
by Simon Merrett, based on insight from Oleg Mazurov, Nick Gammon, rt, Steve Spence | |
modified at EE to include the select switch | |
Tutorial at: | |
http://exploreembedded.com/wiki/Interactive_Menus_for_your_project_with_a_Display_and_an_Encoder | |
*/ | |
static int pinA = 2; // Our first hardware interrupt pin is digital pin 2 | |
static int pinB = 3; // Our second hardware interrupt pin is digital pin 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int counter = 0; | |
string line; | |
// Read the file and display it line by line. | |
System.IO.StreamReader file = | |
new System.IO.StreamReader("c:\\test.txt"); | |
while((line = file.ReadLine()) != null) | |
{ | |
Console.WriteLine (line); | |
counter++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.IO; | |
namespace SyncFTP | |
{ | |
public static class OsHelper | |
{/// <summary> | |
/// | |
/// </summary> | |
/// <param name="path"></param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |
<ListBox.ItemsPanel> | |
<ItemsPanelTemplate> | |
<WrapPanel IsItemsHost="True" /> | |
</ItemsPanelTemplate> | |
</ListBox.ItemsPanel> | |
<ListBoxItem>listbox item 1</ListBoxItem> | |
<ListBoxItem>listbox item 2</ListBoxItem> | |
<ListBoxItem>listbox item 3</ListBoxItem> | |
<ListBoxItem>listbox item 4</ListBoxItem> |