Posts
Showing posts from March, 2020
Enum c#
- Get link
- X
- Other Apps
namespace CSharpTutorial { enum Browser { Firefox, Chrome, Safari, IE } class Program { public static void Main(string[] args) { Console.WriteLine(getBrowser(Browser.Chrome)); Console.ReadKey(); } public static String getBrowser(Browser browser) { if (browser == Browser.Chrome) return "Opening the Chrome Browser"; else if (browser == Browser.Firefox) return "Opening the Firefox Browser"; ...
Hash table , Dictionary C#
- Get link
- X
- Other Apps
/Hashtable Hashtable table = new Hashtable(); table.Add("userName", "sudheer"); table.Add("Password", "Reddy"); table.Add("Age", "32"); table.Add("Country", "India"); Console.ReadKey(); Console.WriteLine(table.Count); foreach (var key in table.Keys) Console.WriteLine(" " + key + ": " + table[key]); //Dictionary String[] names1 = new string[] { "sudheer", "kumar", "reddy", "chittireddy" }; String[] names2 = new string[] { "suresh", "kumar", "reddy", "chittiredd...