瀹??舵?版???濡?浣?瀹??拌〃?肩??淇?瀛???璇诲??

????璺ㄥ钩?板??舵?版?????渚?浜?琛ㄦ?肩??淇?瀛???璇诲?????斤???互灏?琛ㄦ?间腑??瀹逛?瀛??虫????XT??HTML??浠讹???XCEL??娴?瑙??ㄤ腑?ョ????涔???互浣跨?ㄦ?ヨ〃璇诲??缂?杈?濂界??EXCEL??浠躲??????????郴缁?锛???互瀹??伴???虹??h???ㄤ?瀛??虫???版??浠躲????寮?绐??h???ㄨ???绛????ㄥ????浣???涓??㈠?甯哥?ㄧ??琛ㄦ?间?瀛???璇诲???规?杩?琛?璇︾?浠?缁???

涓???琛ㄦ?肩??淇?瀛???璇诲???芥??/p>

1??SaveToText(string FileName,bool Tab,int WithHorHeader,int WithVerHeader)
????璇存??锛?淇?瀛?涓烘??????浠躲??
???????帮?
????????FileName锛?瀛?绗︿覆??????浠跺??,????矾寰???缂虹??璺??涓哄伐绋??圭??????ユ??浠跺??涓虹┖锛???寮瑰?烘??浣?绯荤?淇?瀛?瀵硅?妗???
????????Tab锛?甯?灏?????杈??烘?煎???0锛?CVS?煎?锛?1锛??惰〃绗︽?煎???
????????WithHorHeader锛??村???????︿???姘村钩琛ㄥご??1涓轰???锛??﹀??涓?淇?????
????????WithVerHeader锛??村???????︿??????磋〃澶淬??1涓轰???锛??﹀??涓?淇?????
????????杩????硷?甯?灏?????1琛ㄧず????锛??﹀??澶辫触??
2??SaveToHtml(string FileName,int WithHorHeader,int WithVerHeader)
????璇存??锛?淇?瀛?涓?TML??浠讹?璇ユ??浠舵?煎???娇?ㄦ?瑙??ㄦ??寮?锛?涔???互??XCEL??WPS??寮???
???????帮?
????????FileName锛?瀛?绗︿覆??????浠跺??,????矾寰???缂虹??璺??涓哄伐绋??圭?????
????????WithHorHeader锛??村???????︿???姘村钩琛ㄥご??1涓轰???锛??﹀??涓?淇?????
????????WithVerHeader锛??村???????︿??????磋〃澶淬??1涓轰???锛??﹀??涓?淇?????
????????杩????硷?甯?灏?????1琛ㄧず????锛??﹀??澶辫触??
3??LoadFromText(string FileName,bool Tab,int WithHorHeader,int WithVerHeader)
????璇存??锛?浠???????浠跺??ユ?ヨ〃锛??ヨ〃??????瀹瑰?琚???ゃ??
???????帮?
????????FileName锛?瀛?绗︿覆??????浠跺??,????矾寰???缂虹??璺??涓哄伐绋??圭?????
????????Tab锛?甯?灏?????杈??烘?煎???0锛?CVS?煎?锛?1锛??惰〃绗︽?煎???
????????WithHorHeader锛??村???????﹀??ユ按骞宠〃澶淬??1涓哄??ワ??﹀??涓?瀵煎?ャ??
????????WithVerHeader锛??村???????﹀??ュ???磋〃澶淬??1涓哄??ワ??﹀??涓?瀵煎?ャ??
????????杩????硷?甯?灏?????1琛ㄧず????锛??﹀??澶辫触??

浜???琛ㄦ?肩??淇?瀛???璇诲??甯哥?ㄦ?规?

1?????ㄦ?瑰?瀹??拌〃?肩??淇?瀛???璇诲??
?????ㄧ??d腑缁???琛ㄦ?笺???ㄤ?杈??ヨ矾寰?????浠跺????缂?杈?妗???淇?瀛?璇诲???????濡?涓?锛?

001.png

??????涓??т欢????绉颁负锛?
????????琛ㄦ?硷?Table
????????淇?瀛?缂?杈?妗?锛?Editsave
????????淇?瀛??????save
????????璇诲??缂?杈?妗?锛?Editload
????????璇诲???????load
?????ㄢ??淇?瀛??????????????涓???????腑杈??ュ?涓??????
????????Table.SaveToText(Editsave.Text,1,1,1);
????浠ヤ?????〃绀哄?琛ㄦ?煎??瀹逛?瀛?涓哄?惰〃绗︽?煎?????????浠讹?璺??????浠跺???ㄤ?瀛?缂?杈?妗?涓???ワ?淇???姘村钩琛ㄥご?????磋〃澶淬??
?????ㄢ??璇诲???????????????涓???????腑杈??ュ?涓??????
????????Table.LoadFromText(Editload.Text,1,1,1);
????浠ヤ?????〃绀哄??惰〃绗︽?煎?????????浠跺??ヨ〃?硷?璺??????浠跺???ㄨ???缂?杈?妗?涓???ワ?瀵煎?ユ按骞宠〃澶村?????磋〃澶淬??
????杩?琛???锛??ㄨ〃?间腑杈??ユ??????锛??ㄤ?瀛?缂?杈?妗?涓????23.txt锛?榛?璁よ矾寰?涓哄伐绋????锛?锛??瑰?烩??淇?瀛?????????冲???ㄥ伐绋????涓??惧?板??涓?23.txt????????浠躲????娇??XCEL??寮?锛???瀹逛?琛ㄦ?间腑杈??ョ??涓??淬??

002.png

????琛ㄦ?间腑杈??ユ??????锛??ㄤ?瀛?缂?杈?妗?涓????23.txt锛??瑰?烩??淇?瀛?????????

003.png

宸ョ????涓??冲???惧?板??涓?23.txt????????浠?/p>

004.png

浣跨??XCEL??寮?锛???瀹逛?琛ㄦ?间腑杈??ョ??涓???/p>

??????XCEL涓??杈?123.txt??????浠跺??淇?瀛??????拌法骞冲?板??舵?版???宸ョ?杩?琛??婚????ㄨ???缂?杈?妗?涓????23.txt锛??瑰?烩??璇诲??????????冲???缂?杈?????123.txt??????浠跺??ヨ?宠〃?硷???瀹逛??淬??

005.png

缂?杈?123.txt??????浠跺??淇?瀛?

006.png

璇诲??缂?杈?妗?涓????23.txt锛??瑰?烩??璇诲????????/p>

007.png

????宸茶?????????浠讹???瀹逛???/p>

2?????ㄦ?瑰?瀹??拌〃?肩??淇?瀛???璇诲??
????浣跨?ㄤ?涓?姝ヤ腑缁???濂界??绐??o??ㄧ??h????????濮?????涓???ュ?涓??????
????????Table.LoadFromText("123.txt",1,1,1);
????浠ヤ?????〃绀哄?ㄦ?绐??e??濮????跺??ュ伐绋????涓???涓?23.txt????????浠讹?浠ュ?惰〃绗︽?煎?瀛????瀵煎?ユ按骞宠〃澶村?????磋〃澶淬??
?????ㄧ??h???????抽????涓???ュ?涓??????
????????Table.SaveToText("123.txt",1,1,1);
????浠ヤ?????〃绀哄?ㄦ?绐??e?抽???跺?ㄥ伐绋????涓?淇?瀛???涓?23.txt????????浠讹?浠ュ?惰〃绗︽?煎?瀛????淇???姘村钩琛ㄥご?????磋〃澶淬??
??????寮?杩?琛??婚???缂?杈?琛ㄦ?煎??锛??抽????c??????寮?绐??f?讹?琛ㄦ?间腑??瀹逛??抽???朵??淬??

008.png

杩?琛?涓??杈?琛ㄦ?煎??锛??抽?????/p>

009.png

??寮?宸ョ????涓???123.txt锛?涓??抽???惰〃?煎??瀹逛???/p>

010.png

??寮?绐??o?琛ㄦ?艰???ㄥ???23.txt锛?涓??抽???跺??瀹逛???/p>

??褰?锛?
????1??SaveToText??SaveToHtml??LoadFromText?芥?颁腑??FileName???帮???娇?ㄧ?瀵硅矾寰????稿?璺??锛??稿?璺????榛?璁ゆ?圭???涓哄伐绋????锛??充?杈??ユ??浠跺???讹?淇?瀛??ㄥ伐绋??????
????2??SaveToText??SaveToHtml?芥?帮?涓?杈??ヨ矾寰?????浠跺???讹?浼?寮瑰?烘??浣?绯荤???淇?瀛?瀵硅?妗?锛?LoadFromText?芥?板?椤昏??ヨ矾寰?/??浠跺????
????3??浣跨?ㄧ??e??濮??????抽???????讹?寤鸿??存?ュ?ㄥ?芥??ileName???颁腑??濂戒?瀛???璇诲????璺??????浠跺????
????4???芥??ileName???颁腑锛?寤鸿?杈??ュ??寸????浠舵?╁???锛?渚?濡?123.txt??123.html锛?涓?瑕?浠?杈???23??
????5??浣跨??aveToText??SaveToHtml?芥?版?讹?杈??ョ??璺??蹇?椤诲凡缁?瀛??ㄣ??txt??html??浠跺??互涓?瀛?????ц??芥?板??浼??板缓?稿???浠躲??
????6??浣跨??aveToText??SaveToHtml?芥?颁?瀛?????浠朵?瑕?????涓?涓?涓???ラ??瑕?淇???锛?璇峰?ㄦ?娆′?瀛??????跺?浠姐??
????7???ヤ娇??XCEL??寮?淇?瀛???txt??浠讹?寤鸿?淇?瀛??煎?浣跨?ㄥ?惰〃绗︺????XCEL涓??杈???淇?瀛??讹?EXCEL浼???濡?涓???绀猴?

011.png

?????瑰?烩???????冲????
????8???ヨ?灏?EXCEL??浠跺??ヨ?宠〃?硷???XCEL涓??娆$?瑰?诲乏涓?瑙?????OFFICE??????-?﹀?涓??朵??煎?锛??ㄥ脊?虹??瀵硅?妗?涓??杈??ヨ?淇?瀛?????浠跺??锛?淇?瀛?绫诲?????┾????????浠讹??惰〃绗﹀????锛???锛??冲??娇?ㄥ?芥?拌?????

012.png
013.png

????9???ц?LoadFromText?芥?板??锛?寤鸿????ц?琛ㄦ?肩??Clear?芥?般??

Baidu
sogou