摘要:问题8:如何使用通配符搜索指定目录内的所有文件;解决方案:使用DirectoryInfo.GetFiles方法的重载版本,它可以接受一个过滤表达式,返回FileInfo数组,另外它的参数还可以指定是否对子目录进行查找。如:dir.GetFiles("*.txt", SearchOption.AllD...
阅读全文
随笔分类 - .Net-C#
该文被密码保护。
摘要:二、目录和文件1. 相关枚举类型a) FileAccess,该枚举类型表示文件的访问权限,可以为以下值。i. Read---对文件拥有读权限ii. ReadWrite---对文件拥有的读写权限iii. Write---对文件拥有写权限b) FileAttributes,该枚举类型表示文件的类型i. ...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Xml;using STEE.SaudiMJCCTV.VideoApplication.Utility;using System.Collections;using System.Windows.Forms;namespace STEE.SaudiMJCCTV.VideoApplication{ public class userListFormParameters { private string userName; public stri
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace UseMethodSynax{ class Student { /// /// 学生姓名 /// private...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace UseQueryExpression{ /// /// 学生成绩 /// class LessonScore {...
阅读全文
摘要:using System;using System.Configuration;namespace Maticsoft.DBUtility{ public class PubConstant { /// /// 获取连接字符串 /// public static string Connect...
阅读全文
摘要:--------------------------------------用途:分页存储过程(对有主键的表效率极高)--说明:------------------------------------CREATEPROCEDUREUP_GetRecordByPage@tblNamevarchar(2...
阅读全文
摘要:using System;using System.Collections;using System.Collections.Specialized;using System.Data;using System.Data.SqlClient;using System.Configuration;us...
阅读全文
摘要://sql server 身份验证 连接字符串private string ConnstrSqlServer = "server=服务器名称;uid=登录名称;pwd=登录密码;database=数据库名称";//windows 身份验证连接字符串private string ConnstrWind...
阅读全文
摘要:打通 C++ 和 C# 关于 COM 组件互相调用的任督二脉 一. 关于从 C# 客户端调用 C++ 非托管代码的方法. 本文不打算叙述, 参看以下文章. http://www.codeproject.com/KB/cs/cominterop.aspx 二. 关于从 C++ 客户端调用 C# 托管代码的方法. (一). 非常直接的方法, 参看这篇文章. http://www.codeproject.com/KB/cs/unmanagedtomanaged.aspx 源代码下载 http://www.cppblog.com/Files/free2000fly/cpp-call-cs.z...
阅读全文
摘要:一、asp.net中导出Execl的方法:在asp.net中导出Execl有两种方法,一种是将导出的文件存放在服务器某个文件夹下面,然后将文件地址输出在浏览器上;一种是将文件直接将文件输出流写给浏览器。在Response输出时,t分隔的数据,导出execl时,等价于分列,n等价于换行。 1、将整个h...
阅读全文
摘要:System.Net.Mail 简介 收藏 System.Net.Mail命名空间是在.NET Framework中新增的,该命名空间提供了发送电子邮件的功能。通过对本章的学习,读者可以轻松地使用.NET Framework提供的类库来发送电子邮件。本章的讲解流程如图18-1所示。图18-1 发送电子邮件的讲解流程18.1 System.Net.Mail 简介System.Net.Mail命名空间...
阅读全文
摘要:一先定义一个委托方法---------第一个类XX//定议委托public event ordinary Ordinary;//定议委托方法public delegate void ordinary(unit sender, string e);//在这里调用委托方法,把实现委托出去Ordinary...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using Microsoft.Office.Interop.Excel;using System.Da...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.Office.Interop;using System.Runtime.InteropServices;...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.OleDb;namespace DAL{ public class exportExcelDAL {...
阅读全文
摘要:public enum unitType { typeConut = 0, declarator = 1,}
阅读全文
摘要:Excel工作进程的创建写结束创建: Microsoft.Office.Interop.Excel.ApplicationClass oExcel = new Microsoft.Office.Interop.Excel.ApplicationClass(); Microsoft.Office.In...
阅读全文