![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c#
iteye_13847
这个作者很懒,什么都没留下…
展开
-
读写Excel, 写入excel指定位置
// 添加引用->Com->Microsoft Excel 12.0 Ojbect Libraryusing Excel = Microsoft.Office.Interop.Excel;string excelPath = @"C:\Documents and Settings\ch\Desktop\transaction.xls"; // 创建一个...原创 2008-02-20 17:20:43 · 845 阅读 · 0 评论 -
固定字符串长度,不足补空格
C# 在字串左(或右)加空格或指定char字符,使字串达到指定长度,如: <% string str1="中国人"; str1=str1.PadLeft(10,'1'); //无第二参数为加空格 Response.Write(str1); //结果为“1111111中国人” , 字串长为10 %> sql 方法1: declare @a nvarchar(50)...2008-10-23 20:48:44 · 3362 阅读 · 0 评论 -
c# 获取字符串中的数字
/// <summary> /// 获取字符串中的数字 /// </summary> /// <param name="str">字符串</param> /// <returns>数字</returns> public static decimal GetNumber(string str) { decim2007-11-06 19:24:47 · 331 阅读 · 0 评论 -
将Excel 填充到表格
/// <summary> /// 将指定的电子表格,检索出来,填充到数据集 /// </summary> /// <param name="strFilePath">Excel 绝对路径</param> /// <param name="strSheetName">Excel 里面的表格名 如sheet1<2007-10-25 09:17:56 · 115 阅读 · 0 评论 -
DataTable 的数据写入到 Excel中
引用Com组件Microsoft.Office 11.0 Object Library。using System;using System.Data;using System.Windows.Forms;// 添加引用->Com->Microsoft Excel 12.0 Ojbect Libraryusing Excel = Microsoft.Office.Interop.Ex...原创 2007-10-24 12:18:34 · 127 阅读 · 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...2007-10-12 23:20:26 · 167 阅读 · 0 评论 -
金额大小写转换
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...2007-10-12 23:16:01 · 227 阅读 · 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 日=curre...原创 2007-10-12 23:12:19 · 54 阅读 · 0 评论 -
带参数委托的用法
类文件代码:using System;using System.Web; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // 给委托注册一个方法,当调用委托的时候,该方法自动执行 H...2008-09-10 18:19:19 · 1008 阅读 · 0 评论 -
Enum转换成DataTable
public static DataTable GetStatus(Type type) { DataTable dt = new DataTable(); dt.Columns.Add("Value"); dt.Columns.Add("Key"); foreach (string...原创 2008-08-19 15:05:41 · 193 阅读 · 0 评论 -
C#播放音频、主机报警
主机报警: using System.Runtime.InteropServices; /// <summary> /// APIFunctions 包含系统中对API的调用的类 /// </summary> public class APIFunctions { /// &...2008-11-03 09:25:50 · 186 阅读 · 0 评论