随笔分类 -  C#

摘要:public class PowersOf2{ static void Main() { // Display powers of 2 up to the exponent of 8: foreach (int i in Power(2, 8)) { Console.Write("{0} ", i); } } public static System.Collections.IEnumerable Power(int number, int exponent) { int ... 阅读全文
posted @ 2014-02-18 20:50 XIAOSHUA 阅读(400) 评论(0) 推荐(0)
摘要:C# String IsNullOrEmpty 阅读全文
posted @ 2013-10-23 19:45 XIAOSHUA 阅读(310) 评论(0) 推荐(0)
摘要:1 /// 2 /// 生成随机字符串 3 /// 4 private class RandomStringGenerator 5 { 6 static readonly Random r = new Random(); 7 const string _chars = "0123456789"; 8 public static string GetRandomString() 9 { 10 char[] buffer = new char[5]; 11 for (int i = 0; i ... 阅读全文
posted @ 2013-03-06 11:16 XIAOSHUA 阅读(264) 评论(0) 推荐(0)
摘要:1 using System; 2 using System.Json; 3 using System.Net.Http; 4 5 namespace WorldBankSample 6 { 7 /// 8 /// Sample download list of countries from the World Bank Data sources at http://data.worldbank.org/ 9 /// 10 class Program11 {12 static string _address = "http://ap... 阅读全文
posted @ 2013-03-06 11:10 XIAOSHUA 阅读(1242) 评论(0) 推荐(0)