Welcome To Snipplr


Everyone's Recent C# Snippets



After postback
0 1397 posted 17 years ago by tshortt
Specifically, this code enables you to pass a string from C# into C++ managed code and then get a C++ pointer to the string's chars. [Marshal.StringToHGlobalAnsi Method](http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marsha...
0 4286 posted 17 years ago by pckujawa
A quick search on the internet reveals all kinds of ways you can calculate with business days. I think is the most simple and efficient. In this example add day of week and weeks separately. The loop is never iterated more then 4 times regardless of...
3 3991 posted 17 years ago by chadj2
Found this in some code I've been maintaining/expanding. Quite clever. Picture an array of bytes in binary 00000111 11100000 00000000 00000000 Now picture an Int32 in Binary 00000000000000000000000000000000 To grab a Little Endian I...
0 2820 posted 17 years ago by rengber
0 1415 posted 17 years ago by leonbda
0 1667 posted 17 years ago by leonbda
0 1856 posted 17 years ago by leonbda
In this case I'm looking for image sources in html and placing them in array.
1 1836 posted 17 years ago by leonbda
Place javascrip refernce or complete javascript code in page header from ascx or aspx file.
0 1827 posted 17 years ago by leonbda
Validate any string programmatically via regular expression.
0 1412 posted 17 years ago by leonbda
0 1189 posted 17 years ago by Elph
This snippet is actually tested for SQL Server Compact Edition (CE) 3.5, but it will probably work for other SQL Server editions. Once you have an SQL CE db up and running, you can set the connection string to point to any directory and database by s...
0 2485 posted 17 years ago by pckujawa
See [Raise and Handle Events Generically](http://snipplr.com/view/15033/raise-and-handle-events-generically/) for a better way to use events (generically) and links to best practices in .NET events. This example should be used as a Console program...
0 1603 posted 17 years ago by pckujawa
This function provides C# with functionality similar to the apparently deprecated my.Computer.FileSystem.FindInFiles under the Microsoft.VisualBasic namespace. Example usage: IEnumerable<string> oemFiles = FindInFiles(...
1 2112 posted 17 years ago by jimfred
0 1128 posted 17 years ago by Elph
If you add a ContextMenuStrip (the menu that shows up when you right-click on something) to your design, you can conveniently have more than one form control use that context menu. The only problem is that you don't know which control the context men...
0 3737 posted 17 years ago by pckujawa
AccessHelperUtility.cs
0 1123 posted 17 years ago by mn232nm
AccessHelperParameterCache
0 1050 posted 17 years ago by mn232nm
1 1531 posted 17 years ago by mamoo
0 1289 posted 17 years ago by Anthony
To run this demo, you need to download and install the trial verson of ImgX Controls from [here](http://www.atalasoft.com/download/ImgX64.exe). You may also want to download a scanner emulator (TWAIN data source), such as _TWAIN WG sample source_ ava...
0 2005 posted 17 years ago by dreamlusion
0 1349 posted 17 years ago by Anthony
3 2290 posted 17 years ago by Anthony
4 2344 posted 17 years ago by Anthony
Properly escapes the query string, according to http://code.google.com/apis/searchappliance/documentation/46/xml_reference.html#appendix_url_escaping
3 1776 posted 17 years ago by AndrewVos
How to use WebClient to post to an ASP.Net page and maintain viewstate for proxy purposes.
0 1577 posted 17 years ago by BlueCockatoo