Tuesday, February 7, 2023

Tail Command for Windows


















Tial is orginally a Unix command that has been ported to Windows that prints last ‘N’ lines of any text file.

Tail command for Windows is one to the tools in the Windows Server 2003 Resource Kit Tools free upgrade provided by Microsoft. It has been discounted and not available from official Microsoft support sites any longer. Luckily, we have the Way Back Machine to our rescue.

Getting tail command for Windows

Firstly, download Windows resource kit from the Internet Archive link

📂Microsoft Windows Server 2003 Resource Kit Tools (English) : Microsoft Corporation : Free Download, Borrow, and Streaming : Internet Archive

Run the en_windows_server_2003_reskit.exe


It installs the tools in the default directory C:\Program Files\Windows Resource Kits\Tools

Add path to Environment Variable to avoid changing directory to the install directory
How to: Add Tool Locations to the PATH Environment Variable | Microsoft Learn

or unzip the msi and copy tail.exe to C:\Windows\System32 

  1. Download 7-Zip from this page and install it.
  2. Right-click on the .exe file (menu choose 7-Zip > Extract to "en_windows_server_2003_reskit\")
  3. Navigate to folder and right-click on the rktools.msi file (from the menu choose 7-Zip > Extract to "rktools\"
  4. Navigate to folder and copy tail.exe to c:\Windows\System32

Tail command usage

C:\Program Files\Windows Resource Kits\Tools>tail.exe /?
usage: TAIL [switches] [filename]*
switches: [-?] display this message
[-n] display last n lines of each file (default 10)
[-f filename] keep checking filename for new lines

Examples:

To print the last 10 lines of the file  data.txt:

tail -10 A.txt

To print the data as and when it’s added to the file:

tail -f A.txt

The above command is mostly used for viewing log files contents while more data is being written to them. Tail command with -f option does not terminate until the user presses [Ctrl]-[C].

Windows Server 2003 Resource Kit Tools available commands;  

The following tools are provided:

  • Acctinfo.dll (documented in Readme.htm)
  • Adlb.exe: Active Directory Load Balancing Tool
  • Admx.msi: ADM File Parser
  • Atmarp.exe: Windows ATM ARP Server Information Tool
  • Atmlane.exe: Windows ATM LAN Emulation Client Information
  • Autoexnt.exe: AutoExNT Service
  • Cdburn.exe: ISO CD-ROM Burner Tool
  • Checkrepl.vbs: Check Replication
  • Chklnks.exe: Link Check Wizard
  • Chknic.exe: Network Interface Card Compliance Tool for Network Load Balancing
  • Cleanspl.exe: Spooler Cleaner
  • Clearmem.exe: Clear Memory
  • Clusdiag.msi: Cluster Diagnostics and Verification Tool
  • Clusfileport.dll: Cluster Print File Port
  • Clusterrecovery.exe: Server Cluster Recovery Utility
  • Cmdhere.inf: Command Here
  • Cmgetcer.dll: Connection Manager Certificate Deployment Tool
  • Compress.exe: Compress Files
  • Confdisk.exe: Disk Configuration Tool
  • Consume.exe: Memory Consumers Tool
  • Creatfil.exe: Create File
  • Csccmd.exe: Client-Side Caching Command-Line Options
  • Custreasonedit.exe: Custom Reason Editor (documented in Readme.htm)
  • Delprof.exe: User Profile Deletion Utility
  • Dh.exe: Display Heap
  • Diskraid.exe: RAID Configuration Tool
  • Diskuse.exe: User Disk Usage Tool
  • Dnsdiag.exe: SMTP DNS Diagnostic Tool (documented in Readme.htm)
  • Dumpfsmos.cmd: Dump FSMO Roles
  • Dvdburn.exe: ISO DVD Burner Tool
  • Empty.exe: Free Working Set Tool
  • Eventcombmt.exe: Check Replication
  • Fcopy.exe: File Copy Utility for Message Queuing
  • Frsflags.vbs
  • Getcm.exe: Connection Manager Profile Update
  • Gpmonitor.exe: Group Policy Monitor
  • Gpotool.exe: Group Policy Objects
  • Hlscan.exe: Hard Link Display Tool
  • Ifilttst.exe: IFilter Test Suite
  • Ifmember.exe: User Membership Tool
  • Inetesc.adm: Internet Explorer Enhanced Security Configuration
  • Iniman.exe: Initialization Files Manipulation Tool
  • Instcm.exe: Install Connection Manager Profile
  • Instsrv.exe: Service Installer
  • Intfiltr.exe: Interrupt Affinity Tool
  • Kerbtray.exe: Kerberos Tray
  • Kernrate.exe: Kernel Profiling Tool
  • Klist.exe: Kerberos List
  • Krt.exe: Certification Authority Key Recovery
  • Lbridge.cmd: L-Bridge
  • Linkd.exe
  • Linkspeed.exe: Link Speed
  • List.exe: List Text File Tool
  • Lockoutstatus.exe: Account Lockout Status (documented in Readme.htm)
  • Logtime.exe
  • Lsreport.exe: Terminal Services Licensing Reporter
  • Lsview.exe: Terminal Services License Server Viewer
  • Mcast.exe: Multicast Packet Tool
  • Memmonitor.exe: Memory Monitor
  • Memtriage.exe: Resource Leak Triage Tool
  • Mibcc.exe: SNMP MIB Compiler
  • Moveuser.exe: Move Users
  • Mscep.dll: Certificate Services Add-on for Simple Certificate Enrollment Protocol
  • Nlsinfo.exe: Locale Information Tool
  • Now.exe: STDOUT Current Date and Time
  • Ntimer.exe: Windows Program Timer
  • Ntrights.exe
  • Oh.exe: Open Handles
  • Oleview.exe: OLE/COM Object Viewer
  • Pathman.exe: Path Manager
  • Permcopy.exe: Share Permissions Copy
  • Perms.exe: User File Permissions Tool
  • Pfmon.exe: Page Fault Monitor
  • Pkiview.msc: PKI Health Tool
  • Pmon.exe: Process Resource Monitor
  • Printdriverinfo.exe: Drivers Source
  • Prnadmin.dll: Printer Administration Objects
  • Qgrep.exe
  • Qtcp.exe: QoS Time Stamp
  • Queryad.vbs: Query Active Directory
  • Rassrvmon.exe: RAS Server Monitor
  • Rcontrolad.exe: Active Directory Remote Control Add-On
  • Regini.exe: Registry Change by Script
  • Regview.exe (documented in Readme.htm)
  • Remapkey.exe: Remap Windows Keyboard Layout
  • Robocopy.exe: Robust File Copy Utility
  • Rpccfg.exe: RPC Configuration Tool
  • Rpcdump.exe
  • Rpcping.exe
  • RPing: RPC Connectivity Verification Tool
  • Rqc.exe: Remote Access Quarantine Client
  • Rqs.exe: Remote Access Quarantine Agent
  • Setprinter.exe: Spooler Configuration Tool
  • Showacls.exe
  • Showperf.exe: Performance Data Block Dump Utility
  • Showpriv.exe: Show Privilege
  • Sleep.exe: Batch File Wait
  • Sonar.exe: FRS Status Viewer
  • Splinfo.exe: Print Spooler Information
  • Srvany.exe: Applications as Services Utility
  • Srvcheck.exe: Server Share Check
  • Srvinfo.exe: Remote Server Information
  • Srvmgr.exe: Server Manager
  • Ssdformat.exe: System State Data Formatter
  • Subinacl.exe
  • Tail.exe - List last n line of a file
  • Tcmon.exe: Traffic Control Monitor
  • Timeit.exe (documented in Readme.htm)
  • Timezone.exe: Daylight Saving Time Update Utility
  • Tsctst.exe: Terminal Server Client License Dump Tool
  • Tsscalling.exe: Terminal Services Scalability Planning Tools
  • Uddicatschemeeditor.exe: UDDI Services Categorization Scheme Editor
  • Uddiconfig.exe: UDDI Services Command-line Configuration Utility
  • Uddidataexport.exe: UDDI Data Export Wizard
  • Usrmgr.exe: User Manager for Domains
  • Vadump.exe: Virtual Address Dump
  • Vfi.exe: Visual File Information
  • Volperf.exe: Shadow Copy Performance Counters
  • Volrest.exe: Shadow Copies for Shared Folders Restore Tool
  • Vrfydsk.exe: Verify Disk
  • Winexit.scr: Windows Exit Screen Saver
  • Winhttpcertcfg.exe: WinHTTP Certificate Configuration Tool
  • Winhttptracecfg.exe: WinHTTP Tracing Facility Configuration Tool
  • Winpolicies.exe: Policy Spy
  • Wins.dll: WINS Replication Network Monitor Parser
  • Wlbs_hb.dll & Wlbs_rc.dll: Windows Load Balancing Server Network Monitor Parsers


Tuesday, January 31, 2023

Fix Paths Too Long Automatically


Path Too Long Auto Fixer v5.1 - is the 1st tool that discovers, reports and auto corrects filenames and paths that are too long to fit under the Windows MAXPATH 260 character limit


Path Too Long Auto Fixer is the 1st tool that discovers, reports and auto corrects filenames and paths that are too long to fit under the MAXPATH 260 character limit in bulk. 
Be sure all your back-up files are copied. Other tools make you go through hundreds of files, one-by-one, renaming and copying them somewhere. Who has time for that now-avoidable activity? Save a huge amount of an IT administrators time to correct this.




The most common way to get the path too long error is to have a too many sub-directories. For example the path below has 20 sub-directories! This is known a as deep directory and is very common in many work place shared drives, downloads and files shared on other operating systems (Max\Linux). The other common way is a filename is just too long.

Sunday, January 29, 2023

C# All string escape sequences


C# defines the following character escape sequences:

Strings - C# Programming Guide | Microsoft Learn


String escape sequences

Escape sequenceCharacter nameUnicode encoding
\'Single quote0x0027
\"Double quote0x0022
\\Backslash0x005C
\0Null0x0000    In .NET there is no special meaning to this character. It does not represent end of string as in C or C++. See .NET internal storage code share.
\aAlert0x0007
\bBackspace0x0008
\fForm feed0x000C
\nNew line0x000A
\rCarriage return0x000D
\tHorizontal tab0x0009
\vVertical tab0x000B
\uUnicode escape sequence (UTF-16)\uHHHH (range: 0000 - FFFF; example: \u00E7 = "ç")
\UUnicode escape sequence (UTF-32)\U00HHHHHH (range: 000000 - 10FFFF; example: \U0001F47D = "👽")
\xUnicode escape sequence similar to "\u" except with variable length\xH[H][H][H] (range: 0 - FFFF; example: \x00E7 or \x0E7 or \xE7 = "ç")

Warning

When using the \x escape sequence and specifying less than 4 hex digits, if the characters that immediately follow the escape sequence are valid hex digits (i.e. 0-9, A-F, and a-f), they will be interpreted as being part of the escape sequence. For example, \xA1 produces "¡", which is code point U+00A1. However, if the next character is "A" or "a", then the escape sequence will instead be interpreted as being \xA1A and produce "ਚ", which is code point U+0A1A. In such cases, specifying all 4 hex digits (e.g. \x00A1 ) will prevent any possible misinterpretation.

Note

If a character that does not appear in the table above is preceded with a backslash, the character value is returned. For example, if the compiler sees \x it will be treated as x. 

Try to embed all those backslashes is error prone. To avoid this problem, you can use verbatim string literals. Verbatim are start with a @"..."  and escaped characters will be ignored! Therefore printing @"\r\n" will print \r\n. 

Verbatim string literals
 are more convenient for multi-line strings, strings that contain backslash characters, or embedded double quotes. Verbatim strings preserve new line characters as part of the string text. Use double quotation marks to embed a quotation mark inside a verbatim string.

string string filePath = @"C:\Users\Bond007\Documents\";


Related

To cut and paste all control characters into your favorite editor see the following post
Metadata Consulting [dot] ca: Notepad++ Control Characters Explained NUL, SOH, STX, etc

.NET Internal Storage

In fact, you can look into the .NET internal storage of a string using the following code, and it rather expensive and slow to do. But in case you need it, especially when dealing with end of line values '\0' that have no meaning in .NET. 

Tuesday, January 24, 2023

C# NET How to remove ANSI Control Characters fast and reduce to ANSI set




Here's how to reduce a string to ANSI and remove control characters from a string fast in C-Sharp. But be careful since, remove é is not replaces with e. Todo that you need normalize the string, see UnicodetoAscii function. 

ASCII (American Standard Code for Information Interchange) is a 7-bit character set that contains characters from 0 to 127.

The generic term ANSI (American National Standards Institute) is used for 8-bit character sets. These character sets contain the unchanged ASCII character set. In addition, they contain further characters from 128 to 255.


Here's a list of control characters. https://unicode-table.com/en/blocks/general-punctuation/


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System; using System.Text; using System.Linq; using System.Diagnostics; 
					
public static class Program
{
	// Based on http://www.codeproject.com/Articles/13503/Stripping-Accents-from-Latin-Characters-A-Foray-in
	// Proper Normalization
	public static string UnicodeToANSI(this string inString)
	{
		var newStringBuilder = new StringBuilder();
		newStringBuilder.Append(inString.Normalize(NormalizationForm.FormKD)
								.Where(x => (x > 30 && x <= 255))
								.ToArray());
		return newStringBuilder.ToString();
	}
	
	//ANSI characters 32 to 127 correspond to those in the 7-bit ASCII character set,
	public static string ReducetoASCII(this string s)
    {
        StringBuilder sb = new StringBuilder(s.Length);
        foreach (char c in s)
        {
            if ((int)c > 255) // remove chars > 127
                continue;
            if ((int)c < 32)  // remove  control characters 
                continue;
            sb.Append(c);
        }
        return sb.ToString();
    }
	
	public static void Main()
	{
		Stopwatch sw = new Stopwatch(); 
		string french = "A Paris, le cortège parisien s’était élancé à 14 heures.\r\n\tFace à l’affluence, un «itinéraire bis» a été mis en place. D’importants rassemblements ont lieu à Bordeaux, Marseille, Rennes ou Lyon. Suivez la journée avec nos journalistes dans toute la France.";
		string ftemp = string.Empty; 
		string german = "ޘ Trump\t\r\nverwechselt Klägerin Carroll auf Foto mit Ex-Frau – das könnte Folgen haben"; 
		string gtemp = string.Empty; 
		Console.WriteLine(french); 
		
		sw.Start();
		ftemp = french.ReducetoASCII(); 
		sw.Stop(); 
		
		Console.WriteLine("Ansi reduced\r\n" + ftemp + " in " + sw.ElapsedTicks); 
		
		sw.Reset(); 
		sw.Start();
		ftemp = french.UnicodeToANSI(); 
		sw.Stop(); 
		
		Console.WriteLine("Proper Normalization\r\n" + ftemp + " in " + sw.ElapsedTicks); 
				
		Console.WriteLine();
		Console.WriteLine();
		Console.WriteLine(german); 
		
		sw.Reset();
		sw.Start();
		gtemp = german.ReducetoASCII(); 
		sw.Stop(); 
		
		Console.WriteLine("Ansi reduced\r\n" + gtemp + " in " + sw.ElapsedTicks); 
		
		sw.Reset(); 
		sw.Start();
		gtemp = german.UnicodeToANSI(); 
		sw.Stop(); 
		
		Console.WriteLine("Proper Normalization\r\n" + gtemp + " in " + sw.ElapsedTicks); 
		
	}
}

Monday, January 23, 2023

Tangerine phishing email with subject Update your settings to secure your account

For the record, this is a Tangerine phishing email attempt that is recently going around, with subject Update your settings to secure your account

What to do?  Report them, goto bottom of page. 


From : Tangerine xxxxxx <xxxxxx@gmx.de>
Subject : 
 Update your settings to secure your account - Support #xxxxxx

                       







PHISHING LINKs;

1. https://ffjheeg.r.af.d.sendibt2.com/tr/cl/xxxxxxxxxxxxxx...

How to tell this is a Phishing email ?

  1. Check email address in full, if it's not from originating company then it's phishing.
  2. Hover over all links in email, if it's not from the  company's website then forget it.
  3. The best way is to 

How to examine Email Message Source ?

Now lets look at message source
  1. Outlook.com->Actions->View Message Source. 
  2. Gmail.com->More (down arrow to top right)->Show original.
Check for suspicious links, anything that does not originate from apple.com.


Report Phishing Email (not as Spam)

  1. Outlook.com->Junk (at Top)->Phishing Scam
  2. Gmail.com->More (down-arrow to top right)->Report Phishing 

Report Phishing

If you have received this email take it further at 

  1. https://www.google.com/safebrowsing/report_phish/


Report phishing at Microsoft and subsequently government agencies

  1. http://www.microsoft.com/security/online-privacy/phishing-faq.aspx
  2. Report Phishing Sites | CISA
  3. Home - Canada's Anti-Spam Legislation (fightspam.gc.ca)

C# NET How to remove ASCII Control Characters fast and reduce to ASCII set






Here's how to reduce a string to ASCII and remove control characters from a string fast in C-Sharp. But be careful since, remove é is not replaces with e. Todo that you need normalize the string, see UnicodetoAscii function. 

ASCII (American Standard Code for Information Interchange) is a 7-bit character set that contains characters from 0 to 127.

The generic term ANSI (American National Standards Institute) is used for 8-bit character sets. These character sets contain the unchanged ASCII character set. In addition, they contain further characters from 128 to 255.


Here's a list of control characters. https://unicode-table.com/en/blocks/general-punctuation/


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System; using System.Text; using System.Linq; using System.Diagnostics; 
					
public static class Program
{
	// Based on http://www.codeproject.com/Articles/13503/Stripping-Accents-from-Latin-Characters-A-Foray-in
	// Proper Normalization
	public static string UnicodeToAscii(this string s)
	{
		var sb = new StringBuilder(s.Length);
		sb.Append(s.Normalize(NormalizationForm.FormKD)
		.Where(x => (x > 30 && x < 128))
	        .ToArray());
		return sb.ToString();
	}
	
	//ANSI characters 32 to 127 correspond to those in the 7-bit ASCII character set,
	public static string ReducetoASCII(this string s)
    {
        StringBuilder sb = new StringBuilder(s.Length);
        foreach (char c in s)
        {
            if ((int)c > 127) // remove chars > 127
                continue;
            if ((int)c < 32)  // remove  control characters 
                continue;
            sb.Append(c);
        }
        return sb.ToString();
    }
	
	public static void Main()
	{
		Stopwatch sw = new Stopwatch(); 
		string french = "A Paris, le cortège parisien s’était élancé à 14 heures.\r\n\tFace à l’affluence, un «itinéraire bis» a été mis en place. D’importants rassemblements ont lieu à Bordeaux, Marseille, Rennes ou Lyon. Suivez la journée avec nos journalistes dans toute la France.";
		string ftemp = string.Empty; 
		string german = "Trump\t\r\nverwechselt Klägerin Carroll auf Foto mit Ex-Frau – das könnte Folgen haben"; 
		string gtemp = string.Empty; 
		Console.WriteLine(french); 
		
		sw.Start();
		ftemp = french.ReducetoASCII(); 
		sw.Stop(); 
		
		Console.WriteLine("Ansi reduced\r\n" + ftemp + " in " + sw.ElapsedTicks); 
		
		sw.Reset(); 
		sw.Start();
		ftemp = french.UnicodeToAscii(); 
		sw.Stop(); 
		
		Console.WriteLine("Proper Normalization\r\n" + ftemp + " in " + sw.ElapsedTicks); 
				
		Console.WriteLine();
		Console.WriteLine();
		Console.WriteLine(german); 
		
		sw.Reset();
		sw.Start();
		gtemp = german.ReducetoASCII(); 
		sw.Stop(); 
		
		Console.WriteLine("Ansi reduced\r\n" + gtemp + " in " + sw.ElapsedTicks); 
		
		sw.Reset(); 
		sw.Start();
		gtemp = german.UnicodeToAscii(); 
		sw.Stop(); 
		
		Console.WriteLine("Proper Normalization\r\n" + gtemp + " in " + sw.ElapsedTicks); 
		
	}
}

Saturday, January 21, 2023

CSharp dotNET Remove all ANSI Control Characters and reduce to ANSI fast




Here's how to reduce a string to ANSI and remove control characters from a string fast in C-Sharp. But be careful since, remove é is not replaces with e. Todo that you need normalize the string, see UnicodetoAscii function. 

ASCII (American Standard Code for Information Interchange) is a 7-bit character set that contains characters from 0 to 127.

The generic term ANSI (American National Standards Institute) is used for 8-bit character sets. These character sets contain the unchanged ASCII character set. In addition, they contain further characters from 128 to 255.


Here's a list of control characters. https://unicode-table.com/en/blocks/general-punctuation/


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System; using System.Text; using System.Linq; using System.Diagnostics; 
					
public static class Program
{
	// Based on http://www.codeproject.com/Articles/13503/Stripping-Accents-from-Latin-Characters-A-Foray-in
	// Proper Normalization
	public static string UnicodeToANSI(this string s)
	{
		var sb = new StringBuilder();
		sb.Append(s.Normalize(NormalizationForm.FormKD)
		.Where(x => (x > 30 && x <= 255))
		.ToArray());
		return sb.ToString();
	}
	
	//ANSI characters 32 to 127 correspond to those in the 7-bit ASCII character set,
	public static string ReducetoASCII(this string s)
    {
        StringBuilder sb = new StringBuilder(s.Length);
        foreach (char c in s)
        {
            if ((int)c > 255) // remove chars > 127
                continue;
            if ((int)c < 32)  // remove  control characters 
                continue;
            sb.Append(c);
        }
        return sb.ToString();
    }
	
	public static void Main()
	{
		Stopwatch sw = new Stopwatch(); 
		string french = "A Paris, le cortège parisien s’était élancé à 14 heures.\r\n\tFace à l’affluence, un «itinéraire bis» a été mis en place. D’importants rassemblements ont lieu à Bordeaux, Marseille, Rennes ou Lyon. Suivez la journée avec nos journalistes dans toute la France.";
		string ftemp = string.Empty; 
		string german = "ޘ Trump\t\r\nverwechselt Klägerin Carroll auf Foto mit Ex-Frau – das könnte Folgen haben"; 
		string gtemp = string.Empty; 
		Console.WriteLine(french); 
		
		sw.Start();
		ftemp = french.ReducetoASCII(); 
		sw.Stop(); 
		
		Console.WriteLine("Ansi reduced\r\n" + ftemp + " in " + sw.ElapsedTicks); 
		
		sw.Reset(); 
		sw.Start();
		ftemp = french.UnicodeToANSI(); 
		sw.Stop(); 
		
		Console.WriteLine("Proper Normalization\r\n" + ftemp + " in " + sw.ElapsedTicks); 
				
		Console.WriteLine();
		Console.WriteLine();
		Console.WriteLine(german); 
		
		sw.Reset();
		sw.Start();
		gtemp = german.ReducetoASCII(); 
		sw.Stop(); 
		
		Console.WriteLine("Ansi reduced\r\n" + gtemp + " in " + sw.ElapsedTicks); 
		
		sw.Reset(); 
		sw.Start();
		gtemp = german.UnicodeToANSI(); 
		sw.Stop(); 
		
		Console.WriteLine("Proper Normalization\r\n" + gtemp + " in " + sw.ElapsedTicks); 
		
	}
}

Friday, January 20, 2023

C# All valid string escape sequences


C# defines the following character escape sequences:

Strings - C# Programming Guide | Microsoft Learn


String escape sequences

Escape sequenceCharacter nameUnicode encoding
\'Single quote0x0027
\"Double quote0x0022
\\Backslash0x005C
\0Null0x0000    In .NET there is no special meaning to this character. It does not represent end of string as in C or C++. See .NET internal storage code share.
\aAlert0x0007
\bBackspace0x0008
\fForm feed0x000C
\nNew line0x000A
\rCarriage return0x000D
\tHorizontal tab0x0009
\vVertical tab0x000B
\uUnicode escape sequence (UTF-16)\uHHHH (range: 0000 - FFFF; example: \u00E7 = "ç")
\UUnicode escape sequence (UTF-32)\U00HHHHHH (range: 000000 - 10FFFF; example: \U0001F47D = "👽")
\xUnicode escape sequence similar to "\u" except with variable length\xH[H][H][H] (range: 0 - FFFF; example: \x00E7 or \x0E7 or \xE7 = "ç")

Warning

When using the \x escape sequence and specifying less than 4 hex digits, if the characters that immediately follow the escape sequence are valid hex digits (i.e. 0-9, A-F, and a-f), they will be interpreted as being part of the escape sequence. For example, \xA1 produces "¡", which is code point U+00A1. However, if the next character is "A" or "a", then the escape sequence will instead be interpreted as being \xA1A and produce "ਚ", which is code point U+0A1A. In such cases, specifying all 4 hex digits (e.g. \x00A1 ) will prevent any possible misinterpretation.

Note

If a character that does not appear in the table above is preceded with a backslash, the character value is returned. For example, if the compiler sees \x it will be treated as x. 

Try to embed all those backslashes is error prone. To avoid this problem, you can use verbatim string literals. Verbatim are start with a @"..."  and escaped characters will be ignored! Therefore printing @"\r\n" will print \r\n. 

Verbatim string literals
 are more convenient for multi-line strings, strings that contain backslash characters, or embedded double quotes. Verbatim strings preserve new line characters as part of the string text. Use double quotation marks to embed a quotation mark inside a verbatim string.

string string filePath = @"C:\Users\Bond007\Documents\";


Related

To cut and paste all control characters into your favorite editor see the following post
Metadata Consulting [dot] ca: Notepad++ Control Characters Explained NUL, SOH, STX, etc

.NET Internal Storage

In fact, you can look into the .NET internal storage of a string using the following code, and it rather expensive and slow to do. But in case you need it, especially when dealing with end of line values '\0' that have no meaning in .NET.