Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.IO;

Expand All @@ -7,7 +7,7 @@ class GetAName
public static void Main(string[] args)
{
DirectoryInfo dir = new DirectoryInfo(".");
String dirName=dir.Name;
string dirName=dir.Name;
Console.WriteLine("DirectoryInfo name is {0}.", dirName);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Reflection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Reflection;

Expand Down Expand Up @@ -37,7 +37,7 @@ public static void PrintAttributes(Type attribType, int iAttribValue)
FieldInfo[] fields = attribType.GetFields(BindingFlags.Public | BindingFlags.Static);
for (int i = 0; i < fields.Length; i++)
{
int fieldvalue = (Int32)fields[i].GetValue(null);
int fieldvalue = (int)fields[i].GetValue(null);
if ((fieldvalue & iAttribValue) == fieldvalue)
{
Console.WriteLine(fields[i].Name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//<Snippet1>
//<Snippet1>

using System;
using System.Reflection;
Expand Down Expand Up @@ -42,7 +42,7 @@ public static void PrintAttributes(Type attribType, int iAttribValue)
FieldInfo[] fields = attribType.GetFields(BindingFlags.Public | BindingFlags.Static);
for (int i = 0; i < fields.Length; i++)
{
int fieldvalue = (Int32)fields[i].GetValue(null);
int fieldvalue = (int)fields[i].GetValue(null);
if ((fieldvalue & iAttribValue) == fieldvalue)
{
Console.WriteLine(fields[i].Name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Reflection;
using System.Reflection.Emit;
Expand All @@ -8,7 +8,7 @@ class SwapMethodBodySample
{
// First make a method that returns 0.
// Then swap the method body with a body that returns 1.
public static void Main(String [] args)
public static void Main(string [] args)
{
// Construct a dynamic assembly
Guid g = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Globalization;

Expand All @@ -20,7 +20,7 @@ public static void Main() {
for (int i = 0; i <= 4; i++) {
nfi.NumberNegativePattern = i;
Console.WriteLine("{0,-20} {1,-10}",
String.Format("Pattern {0}:",
string.Format("Pattern {0}:",
nfi.NumberNegativePattern),
value.ToString("N", nfi));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Reflection;

Expand Down Expand Up @@ -40,7 +40,7 @@ public static int Main(string[] args)

Reflection.ParameterInfo

Mymethodbase = Void mymethod (Int32, System.String ByRef, System.String ByRef)
Mymethodbase = Void mymethod (int, System.String ByRef, System.String ByRef)
For parameter # 0, the IsOut is - False
For parameter # 1, the IsOut is - True
For parameter # 2, the IsOut is - False
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Reflection;

Expand Down Expand Up @@ -41,7 +41,7 @@ public static int Main(string[] args)
Reflection.ParameterInfo

Mymethodbase
= Void mymethod (Int32, System.String ByRef, System.String ByRef)
= Void mymethod (int, System.String ByRef, System.String ByRef)
For parameter # 0, the Name is - int1m
For parameter # 1, the Name is - str2m
For parameter # 2, the Name is - str3m
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Reflection;

Expand Down Expand Up @@ -41,7 +41,7 @@ public static int Main(string[] args)

Reflection.Parameterinfo

Mymethodbase = Void mymethod(Int32, System.String ByRef, System.String ByRef)
Mymethodbase = Void mymethod(int, System.String ByRef, System.String ByRef)
For parameter # 0, the ParameterType is - System.Int32
For parameter # 1, the ParameterType is - System.String&
For parameter # 2, the ParameterType is - System.String&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Collections;
public class SamplesQueue {
Expand All @@ -15,7 +15,7 @@ public static void Main() {
mySourceQ.Enqueue( "barn" );

// Creates and initializes the one-dimensional target Array.
Array myTargetArray=Array.CreateInstance( typeof(String), 15 );
Array myTargetArray=Array.CreateInstance( typeof(string), 15 );
myTargetArray.SetValue( "The", 0 );
myTargetArray.SetValue( "quick", 1 );
myTargetArray.SetValue( "brown", 2 );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,15 +16,15 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
string [] names = rkey.GetSubKeyNames();

int icount = 0;

Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,15 +16,15 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
string [] names = rkey.GetSubKeyNames();

int icount = 0;

Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,15 +16,15 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
string [] names = rkey.GetSubKeyNames();

int icount = 0;

Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,7 +16,7 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names;
string [] names;
try {
names = rkey.GetSubKeyNames();
}
Expand All @@ -31,7 +31,7 @@ static void PrintKeys(RegistryKey rkey) {
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,15 +16,15 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
string [] names = rkey.GetSubKeyNames();

int icount = 0;

Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,15 +16,15 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
string [] names = rkey.GetSubKeyNames();

int icount = 0;

Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand All @@ -16,15 +16,15 @@ public static void Main() {
static void PrintKeys(RegistryKey rkey) {

// Retrieve all the subkeys for the specified key.
String [] names = rkey.GetSubKeyNames();
string [] names = rkey.GetSubKeyNames();

int icount = 0;

Console.WriteLine("Subkeys of " + rkey.Name);
Console.WriteLine("-----------------------------------------------");

// Print the contents of the array to the console.
foreach (String s in names) {
foreach (string s in names) {
Console.WriteLine(s);

// The following code puts a limit on the number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using Microsoft.Win32;

Expand Down Expand Up @@ -33,7 +33,7 @@ public static void Main()
Console.WriteLine();
break;
case RegistryValueKind.DWord:
Console.WriteLine("Value = " + Convert.ToString((Int32)o));
Console.WriteLine("Value = " + Convert.ToString((int)o));
break;
case RegistryValueKind.QWord:
Console.WriteLine("Value = " + Convert.ToString((Int64)o));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <Snippet1>
// <Snippet1>
using System;
using System.Resources;

Expand Down