public static DataTable GetStatus(Type type) { DataTable dt = new DataTable(); dt.Columns.Add("Value"); dt.Columns.Add("Key"); foreach (string str in Enum.GetNames(type)) { DataRow dr = dt.NewRow(); ...
  • 15:05
  • 浏览 (8)
  • 评论 (0)
  • 分类: c#
/// <summary>  /// 获取字符串中的数字  /// </summary>  /// <param name="str">字符串</param>  /// <returns>数字</returns>  public static decimal GetNumber(string str)  {   decimal result = 0;  & ...
  • 19:24
  • 浏览 (389)
  • 评论 (0)
  • 分类: c#
/// <summary>  /// 将指定的电子表格,检索出来,填充到数据集  /// </summary>  /// <param name="strFilePath">Excel 绝对路径</param>  /// <param name="strSheetName">Excel 里面的表格名 如sheet1</param>  /// <returns>DataSet ...
  • 09:17
  • 浏览 (152)
  • 评论 (0)
  • 分类: c#
引用Com组件Microsoft.Office 11.0 Object Library。using System;using System.Data;using System.Data.SqlClient;using System.Reflection;using Microsoft.Office.Tools.Excel;/// <summary>/// ExcelProgram 的摘要说明/// </summary>public class ExcelProgram{ public ExcelProgram() {  //&nb ...
  • 12:18
  • 浏览 (263)
  • 评论 (0)
  • 分类: c#
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { ...
  • 23:20
  • 浏览 (208)
  • 评论 (0)
  • 分类: c#
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; /// /// Summary description for Money2String /// ...
  • 23:16
  • 浏览 (261)
  • 评论 (0)
  • 分类: c#
字符串:string s = "1,2,3,4,5," 目标:删除最后一个 "," 方法一: s = s.Substring(0,s.Length - 1) 方法二: s = s.RTrim(',') 方法三: s=s.Remove(s.Length - 2, 1)
  • 23:15
  • 浏览 (237)
  • 评论 (0)
  • 分类: c#
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=currentTime.Day; 1.5 取当前时 int 时=currentTime.Hour; 1.6 取当前分 int 分=currentTime.Minute; 1.7 取当前秒 int 秒=curre ...
  • 23:12
  • 浏览 (217)
  • 评论 (0)
  • 分类: c#