OtherHelper

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace Ella.ToolKit { ///

/// 其他工具 /// Author : AnDequan /// Date : 2010-12-23 /// public sealed class Other : Singleton { /// /// 创建一个网站快捷方式 /// Author : AnDequan /// Date : 2010-12-23 /// /// 要连接网站的地址 /// 要创建的位置 /// 快捷方式名称 public bool InternetShortcut(string url, string path, string shortcutName) { bool bIsSuccess; try { StringBuilder sbShortcutName = new StringBuilder(); sbShortcutName.AppendLine("[InternetShortcut]"); sbShortcutName.AppendLine("URL=" + url); if (!shortcutName.EndsWith(".url")) { shortcutName += ".url"; } FileHelper.Instance.CreateNewFile(path, sbShortcutName.ToString(), shortcutName); bIsSuccess = true; } catch (Exception ex) { bIsSuccess = false; LogHelper.Instance.Add(ex); } return bIsSuccess; } /// /// 根据年份计算生肖 /// Author : AnDequan /// Date : 2011-1-5 /// /// 年份 /// 生肖 public string GetShengXiaoByYear(DateTime time) { int iYear = time.Year; switch (iYear % 12) { case 1: return "鸡"; case 2: return "狗"; case 3: return "猪"; case 4: return "鼠"; case 5: return "牛"; case 6: return "虎"; case 7: return "兔"; case 8: return "龙"; case 9: return "蛇"; case 10: return "马"; case 11: return "羊"; case 0: return "猴"; default: return ""; } } #region User - Defined Private Function #endregion } }

你可能感兴趣的:([,01,],.NET)