using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Text; using System.Windows; using System.Windows.Forms; using System.Windows.Media.Imaging; class Program { private static WebBrowser InitialiseBrowser(string source) { // create a hidden web browser, which will navigate to the page WebBrowser browser = new WebBrowser(); browser.ScrollBarsEnabled = false; // we don’t want scrollbars on our image browser.ScriptErrorsSuppressed… Read more →
Category: unpublished
MethodImplOptions.AggressiveInlining
MethodImplOptions.AggressiveInlining Read more →
css switcher
css switcher Read more →
How to run code from sql server in c#
How to run code from sql server in c# SqlCommand cmd = new SqlCommand(“select Developer from Stackoverflow where UserID=’786′ and Developer=’Sufiyan'”, con); if (con.State == ConnectionState.Closed) { con.Open(); } SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { string codeSnippet = reader[“CodeSnippet”].ToString(); dynamic script = CSScript.LoadCode(@” using System; using System.Windows.Forms; using System.Collections.Generic; using System.Data; using System.Windows.Forms; using System.Data.SqlClient; public class RunFromSqlServer {… Read more →
a debuggable/installable windows service template: Part 1 Part 2 Minor amendment: Program.cs catch (Exception ex) { ConsoleHarness.WriteToConsole(ConsoleColor.Red, “An exception occurred in Main(): {0}”, ex); if (Environment.UserInteractive) { Console.ReadKey(); } } Read more →
type safe enum extensions for MVC
extension method public static class EnumSelectList { public static IEnumerable GetList(this T thing) where T : IEnumerable { var result = from i in thing select new SelectListItem { Text = i.Value }; return result; } } new method on the type public static IEnumerable GetAll() { var list = ( from i in _instances select i.Value) .Cast(); return list;… Read more →
How to log-in to your WordPress site
yoursite\wp-admin Read more →
Connecting to Data in Telerik Reporting with the ObjectDataSource Component
Connecting to Data in Telerik Reporting with the ObjectDataSource Component Read more →
http://www.piotrwalat.net/consuming-asp-net-web-api-services-in-a-windows-8-c-xaml-app/ Read more →
MVC
simple ajax controller (for countries etc) ajax (these are research notes) consuming WebApi with MVC consuming WebApi with MVC Dynamic content in MVC/Razor the following contains xml entries to get past razor runtime compilation errors of namespace not found: @Html.LabelFor(model => model.path.Value, “Path”) @Html.DropDownList(“Path”, new List { new SelectListItem { Text = TypeSafeEnum.a.Value, Value = TypeSafeEnum.a.Value }, new SelectListItem {… Read more →