code_snippets
This is an old revision of the document!
Table of Contents
General
Newlines
C# = Environment.Newline
VB = vbNewline
C#
I/O
Read Entire File into a String
…in one easy step.
String wholeFile = File.ReadAllText(@"C:\Temp.txt");
Filename to StreamReader
…in one easy step.
StreamReader sr = File.OpenText(@"C:\Temp.txt");
VB
Comments
Change Note
''' <ChangeNote> ''' <ChangeNo>CR302610</ChangeNo> ''' <Author>Stephen Heise</Author> ''' <ChangeDate>2008-09-03</ChangeDate> ''' <Description> ''' TBA ''' </Description> ''' </ChangeNote>
Method Header
''' <summary> ''' ''' </summary> ''' <param name="page"></param> ''' <returns></returns> ''' </CreationNote> ''' <ChangeNo>CR302610</ChangeNo> ''' <Author>Stephen Heise</Author> ''' <ChangeDate>2008-09-04</ChangeDate> ''' <Notes>Created to replace existing GetDirectReports method.</Notes> ''' </CreationNote>
SQL
Fix Orphaned User
sp_change_users_login 'auto_fix', 'UserName'
For example:
sp_change_users_login 'auto_fix', 'WebAppsSQLWebUser'
Regular Expressions
Notepad++
Searching for Email Addresses
[A-Za-z\-]+\.[A-Za-z\-]+@ccc\.govt\.nz
MS-DOS Batch File
General Backup Script
code_snippets.1231894671.txt.gz · Last modified: 2017/01/01 19:48 (external edit)