(C#)excel数据导入SqlServer中

编写程序,把附件的EXCEL文件( (实验题附件1)03级学生名单.xls或(实验题附件2)成绩登记表.xls) 导入到SQL SERVER2000数据库中.要求:1、EXCEL文件作为数据源2、根据EXCEL文件的字段在SQL SERVER中建立对应的字段3、把EXECL中的记录导到SQL SERVER中string strCon = " Provider = Microsoft.Jet.OLE …… 阅读全文

C#取得设备网卡的MAC地址和硬盘的卷标号

( 一 ).说明取得设备网卡的MAC地址和硬盘的卷标号( 二 ).图片示例( 三 ).代码using System;using System.Management;namespace NetCard{/// /// 读取设备 /// public class run {private ManagementClass mc;private ManagementObjectCollection m …… 阅读全文

c#中如何判断字符串是否为数字

使用正则表达式:using System.Text.RegularExpressions;string pattern = @^/d+(/./d)?$;if(Text1.Text.Trim()!=){if(!Regex.IsMatch(sign_money.Text.Trim(),pattern)){Text1不是数字;}else{Text1是数字;}}---------------------- …… 阅读全文

C#验证输入的是否数字的方法

其实用正则表达式也可以 static bool IsNumeric(string str) { if (str==null || str.Length==0) return false; foreach(char c in str) { if (!Char.IsNumber(c)) { return false; } } return true; } 正则表达的写法是: static bool I …… 阅读全文

用C#语言构造蜘蛛程序

"蜘蛛"(Spider)是Internet上一种很有用的程序,搜索引擎利用蜘蛛程序将Web页面收集到数据库,企业利用蜘蛛程序监视竞争对手的网站并跟踪变动,个人用户用蜘蛛程序下载Web页面以便脱机使用,开发者利用蜘蛛程序扫描自己的Web检查无效的链接……对于不同的用户,蜘蛛程序有不同的用途。那么,蜘蛛程序到底是怎样工作的呢?   蜘蛛是一种半自动的程序,就象现实当中的蜘蛛在它的Web(蜘蛛网)上旅行 …… 阅读全文

C#读取网站的数据

以下是引用片段:Form1.cs using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Xml; namespace hellojoysou { /// …… 阅读全文