Here is some code.
C#
1 using System.Web;
2 using System.Web.Routing;
3
4 namespace MvcApplication1.Constraints
5 {
6 public class LocalhostConstraint : IRouteConstraint
7 {
8 public bool Match
9 (
10 HttpContextBase httpContext,
11 Route route,
12 string parameterName,
13 RouteValueDictionary values,
14 RouteDirection routeDirection
15 )
16 {
17 return httpContext.Request.IsLocal;
18 }
19
20 }
21 }
VB
1 Public Class LocalhostConstraint
2 Implements IRouteConstraint
3
4 Public Function Match( _
5 ByVal httpContext As HttpContextBase, _
6 ByVal route As Route, _
7 ByVal parameterName As String, _
8 ByVal values As RouteValueDictionary, _
9 ByVal routeDirection As RouteDirection _
10 ) As Boolean Implements IRouteConstraint.Match
11
12 Return httpContext.Request.IsLocal
13 End Function
14
15 End Class
SQL
1 SELECT TOP 1000 [EventLogID]
2 ,[Message]
3 ,[Category]
4 ,[SettingsID]
5 ,[EventID]
6 ,[EventType]
7 ,[EventDate]
8 ,[MachineName]
9 FROM [somedb].[dbo].[sometable] WHERE SettingsID = 1000 AND Message LIKE 'Top%' ORDER BY 1 desc
C# with comments and slashes
1 var targetSchemeAndHost = "http://" + targetHost;
2 //comment;
VB with comments and single quote
1 Dim s As String = "A string with ' a single quote"
2 'comment
longer C#
1 public bool public class Collection:CollectionBase
2
3 {
4
5 public Collection()
6
7 {
8
9 //
10
11 // TODO: Add constructor logic here
12
13 //
14
15 }
16
17 public T this[int index]
18
19 {
20
21 get { return (T)this.List[index]; }
22
23 set { this.List[index] = value; }
24
25 }
26
27
28
29 public int IndexOf(T item)
30
31 {
32
33 return this.List.IndexOf(item);
34
35 }
36
37
38
39 public int Add(T item)
40
41 {
42
43 return this.List.Add(item);
44
45 }
46
47
48
49 public void Remove(T item)
50
51 {
52
53 this.List.Remove(item);
54
55 }
56
57
58
59 public void CopyTo(Array array, int index)
60
61 {
62
63 this.List.CopyTo(array, index);
64
65 }
66
67
68
69 public void AddRange(Collection collection)
70
71 {
72
73 for (int i = 0; i < collection.Count; i++)
74
75 {
76
77 this.List.Add(collection[i]);
78
79 }
80
81 }
82
83 public void AddRange(T[] collection)
84
85 {
86
87 this.AddRange(collection);
88
89 }
90
91 Contains(T item)
92
93 {
94
95 return this.List.Contains(item);
96
97 }
98
99 public void Insert(int index, T item)
100
101 {
102
103 this.List.Insert(index, item);
104
105 }
106
107 }
C# generics
1 Stack<int> intStack = new Stack<int>();
2
3 Dictionary<string, string> dictionary = new Dictionary<string, string>();
4
5 public void MyGenericMethod(T x, T y)
6
7 {
8
9 Console.Writeline("Parameters type is {0}", typeof(T));
10
11 }
pound sign (#) in href attribute
1 <a href="http://forums.asp.net/EditPost.aspx?PostID=3243610&ReturnUrl=%2fthemes%2ffan%2fforums%2fthread.aspx%3fThreadID%3d1437326%26PostID%3d3243610%26PermaPostID%3d3243610%233243610#" mce_href="http://forums.asp.net/EditPost.aspx?PostID=3243610&ReturnUrl=%2fthemes%2ffan%2fforums%2fthread.aspx%3fThreadID%3d1437326%26PostID%3d3243610%26PermaPostID%3d3243610%233243610#">Test</a>
expressions + ) turning into BLOCKED EXPRESSION
CTE (common table expressions)
Pasting from Word
Please my dear Aunt Sally