资源描述:
《Excel导入数据集》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、usingSystem;usingSystem.Data;usingSystem.Data.OleDb;usingSystem.IO;usingSystem.Configuration;usingSystem.Text;usingSystem.Web;usingSystem.Xml;usingSystem.Web.Security;usingSystem.Threading;usingSystem.Web.UI;usingSystem.Text.RegularExpressions;usingSystem.Runtime.InteropSe
2、rvices;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Collections;//////BaseFunction的摘要说明///publicclassBaseFunction{privatestaticBaseFunctionobj=newBaseFunction();publicBaseFunction(){//
3、//TODO:在此处添加构造函数逻辑//}#region配置文件操作方法//调用API[DllImport("kernel32")]privatestaticexternintGetPrivateProfileInt(stringlpApplicationName,stringlpKeyName,intnDefault,stringlpFileName);[DllImport("kernel32")]privatestaticexternboolGetPrivateProfileString(stringlpApplicationName,
4、stringlpKeyName,stringlpDefault,StringBuilderlpReturnedString,intnSize,stringlpFileName);[DllImport("kernel32")]privatestaticexternboolWritePrivateProfileString(stringlpApplicationName,stringlpKeyName,stringlpString,stringlpFileName);[DllImport("kernel32")]privatestaticext
5、ernboolGetPrivateProfileSection(stringlpAppName,StringBuilderlpReturnedString,intnSize,stringlpFileName);[DllImport("kernel32")]privatestaticexternboolWritePrivateProfileSection(stringlpAppName,stringlpString,stringlpFileName);//////写配置文件//////6、="Section">段落名///节点名///节点值///要读取的文件名(不包括.ini)publicstaticboolWriteIni(stringSection,stringKey,stringKeyValue,stringstrName){returnWritePrivateProfileString(Section,Key,KeyValue,strN
7、ame);}//////读配置文件//////段落名///节点名///要读取的文件名(不包括.ini)///publicstaticstringReadIni(stringSection,stringKey,stringstrName){StringBuilderTemp=newStringBuilde
8、r(1000);GetPrivateProfileString(Section,Key,"",Temp,1000,strName);stringrtn=Temp.ToString