發表於 養生

之前上中醫養生課程的筆記

之前為了生小孩除了看西醫做人工、試管外,
也有學了一些養生氣功、上了一些中醫的課,
將中醫課程的筆記整理如下,
因為中醫老師說能幫人是很幸福~~

1.01-中醫基礎講義

2.中醫藥物學

3.十二經絡養生法

4.十二經絡

5.五行表

發表於 程式分享

我的第1支C#程式-將多個word檔合併成一個

一、畫面如下:

二、程式碼

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//以下為新加入
using System.Reflection;
using System.IO;
using Word = Microsoft.Office.Interop.Word;  //VS2005沒有此行,VS2008要用此行
//加入參考==>COM==>Microsoft Office 12.0 Object Library,自動產生參考Word

namespace WordMerge
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void MergeWord_Click(object sender, EventArgs e)
        {
            if (targetPath.Text.Trim().Length <= 0 || sourcePath.Text.Trim().Length <= 0 ||
                targetFileName.Text.Trim().Length <= 0)
            {
                MessageBox.Show(“資料不完整!");
                return;
            }

            Object missing = Missing.Value;
            object oOutputDoc = targetPath.Text.Trim() + @"\" + targetFileName.Text.Trim();

            Word.Application wordApp = new Word.Application();
            Word._Document word = wordApp.Documents.Add(ref missing, ref missing, ref missing, ref missing);
           
            object oPageBreak = Word.WdBreakType.wdPageBreak;

            string[] files = Directory.GetFiles(sourcePath.Text.Trim());
            for (int iIdx = 0; iIdx < files.Length; iIdx++)
            {
                wordApp.Selection.InsertFile(files[iIdx], ref missing, ref missing, ref missing, ref missing);
                wordApp.Selection.InsertBreak(ref oPageBreak);
                wordApp.ActiveDocument.SaveAs(ref oOutputDoc,
                                                ref missing, ref missing, ref missing,
                                                ref missing, ref missing, ref missing,
                                                ref missing, ref missing, ref missing,
                                                ref missing, ref missing, ref missing,
                                                ref missing, ref missing, ref missing);
            }
            wordApp.Quit(ref missing, ref missing, ref missing);

            MessageBox.Show(“合併完成!");
        }

        private void targetPathButton_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog path = new FolderBrowserDialog();
            path.ShowDialog();
            this.targetPath.Text = path.SelectedPath;
        }

        private void sourcePathButton_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog path = new FolderBrowserDialog();
            path.ShowDialog();
            this.sourcePath.Text = path.SelectedPath;
        }
    }
}

發表於 程式分享

C語言補充文件,分享給大家

1.main及環境變數補充講義

2.C語言及工具簡介

3.數字系統

4.浮點數

5.變數等級

6.陣列與指標

7.結構與結構陣列