Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DataSet¡¢Excel¡¢XMLÖ®¼äµÄµ¼Èëµ¼³ö

class ImportExportToExcel
{
public class ImportExportToExcel
{
private string strConn;
private System.Windows.Forms.OpenFileDialog openFileDlg = new System.Windows.Forms.OpenFileDialog();
private System.Windows.Forms.SaveFileDialog saveFileDlg = new System.Windows.Forms.SaveFileDialog();
public ImportExportToExcel()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼­
//
this.openFileDlg.DefaultExt = "xls";
this.openFileDlg.Filter = "ExcelÎļþ (*.xls)|*.xls";
this.saveFileDlg.DefaultExt = "xls";
this.saveFileDlg.Filter = "ExcelÎļþ (*.xls)|*.xls";
}
#region ´ÓExcelÎļþµ¼Èëµ½DataSet
/**/
/// <summary>
/// ´ÓÑ¡ÔñµÄExcelÎļþµ¼Èë
/// </summary>
/// <returns>DataSet</returns>
public DataSet ImportfromExcel()
{
DataSet ds = new DataSet();
if (openFileDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
ds = doImport(openFileDlg.FileName);
return ds;
}
/**/
/// <summary>
/// ´ÓÖ¸¶¨µÄExcelÎļþµ¼Èë
/// </summary>
/// <param name="strFileName">ExcelÎļþÃû</param>
/// <returns></returns>
public DataSet ImportfromExcel(string strFileName)
{
DataSet ds = new DataSet();
ds = doImport(strFileName);
return ds;
}
/**/
/// <summary>
/// Ö´Ðе¼Èë
/// </summary>
/// <param name="strFileName">ÎļþÃû</param>
/// <returns>


Ïà¹ØÎĵµ£º

XML´´½¨¡¢¶Á¡¢Ð´²Ù×÷

Create:
int nFQ;
   XmlDocument doc = new XmlDocument();
   XmlAttribute
newAtt;
   //¶¨ÒåXMLÎĵµÍ·Îļþ
   XmlDeclaration dec =
doc.CreateXmlDeclaration("1.0",null,null);
   doc.AppendChild(dec);
 &n ......

C++ ²Ù×÷XMLµÄÍêÕûÀý×Ó——MSXMLƪ

д±¾ÎĵÄÄ¿µÄÊÇΪÁË·½±ã´ó¼ÒÁ˽âC++ MSXML²Ù×÷·½·¨¡£
µ±È»£¬C++ÖжÔMSXMLµÄµ÷ÓÃÓжàÖÖ£¬±¾ÎIJÉÓõķ½·¨ÊÇÍêÈ«²ÎÕÕMSXML SDKÌṩµÄÎĵµ½øÐвÙ×÷¡£
Èç¹ûÓÐʲô´íÎ󣬻¶Ó­Ö¸Õý¡£
´úÂë¿ò¼ÜÊÇ»ùÓÚvs2008 MFC ¶Ô»°¿ò³ÌÐò£¨UNICODE£©¡£¶Ô»°¿ò³ÌÐòÐèÒª¶ÁÕß×Ô¼º´´½¨¡£
#include <msxml6.h>
#include <comutil.h>
# ......

ʹÓöàÏ̼߳ÓÔØ¶à¸öXmlÎļþµ½TreeView¿Ø¼þ

·­Ò룺Çï·ã
Ô­´úÂ룺
LoadingXmlInTvMTCode.zip

 
ÔںܶàÇé¿öϳÌÐòÔ±ÐèÒª²ÉÓöàÏß³ÌÀ´¿ª·¢Ó¦ÓóÌÐò£¬Óû§¿ÉÒÔÔÚǰ̨²Ù×÷Êý¾Ý»òÆäËû¹¤×÷£¬ÔÚºǫ́³ÌÐòÕýÔÚ¼ÓÔØºÜ´óµÄһЩÎļþ£¬¶øÕâÒ»¹ý³Ì²»»áÓ°Ï쵽ǰ̨µÄÓû§¡£ÔÚÕâÆªÎÄÕÂÖУ¬ÎÒÀ´½²ÊöÒ»ÏÂÔõÑùͨ¹ý¶à¸öÏß³ÌÀ´¼ÓÔØ¶à¸öÎļþ¡£
 
ÔÚÕâ¸öÀý×ÓÖÐÎÒÃǽ«À´Ñо¿Õ ......

¹ØÓÚXMLÖÐ×Ö½ÚдÈëÁ÷×Ö¶ÎʱµÄ˵Ã÷

·½·¨Ò»£º
      ²ÉȡͨÓõÄbase64±àÂ뷽ʽ£¬È¡Ê±½âÂë´æÊ±¼ÓÂë¡£
ëÀÏʦÌṩÁËÍêÕûµÄ±àÂë´úÂ룬ÇÒЧÂʺܸߡ£
unit Base64;

interface

uses SysUtils, Classes;

type
{$IFDEF UNICODE}
Base64String = AnsiString;
{$ELSE}
Base64String = strin ......

XMLÈëÞ«½âÖ®DTD Îļþ¸ñʽ¶¨Òå(XML DTD)

¡¡¡¡DTDʵ¼ÊÉÏ¿ÉÒÔ¿´×÷Ò»¸ö»ò¶à¸öXMLÎļþµÄÄ£°å£¬ÕâЩXMLÎļþÖеÄÔªËØ¡¢ÔªËصÄÊôÐÔ¡¢ÔªËصÄÅÅÁз½Ê½/˳Ðò¡¢ÔªËØÄܹ»°üº¬µÄÄÚÈݵȣ¬¶¼±ØÐë·ûºÏDTDÖе͍Òå¡£XMLÎļþÖеÄÔªËØ£¬¼´ÎÒÃÇËù´´½¨µÄ±ê¼Ç£¬ÊǸù¾ÝÎÒÃÇÓ¦ÓõÄʵ¼ÊÇé¿öÀ´´´½¨µÄ¡£ÏëÒª´´½¨Ò»·ÝÍêÕûÐԸߡ¢ÊÊÓ¦ÐÔ¹ãµÄDTDÊǷdz£À§Äѵģ¬ÒòΪ¸÷Ðи÷Òµ¶¼ÓÐËûÃÇ×Ô¼ºµÄÐÐÒµÌØµã£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ