2011年11月23日 星期三

[Other] 討厭 Facebook 每次有精彩的 要先按 讚 才能看嗎?叫你怎麼直接看..

實在是 太討厭 每次都要 按 讚  才能看圖片了。

針對網址是下列清單 的網站,都有效
太多太多  反正版型都長差不多...自己試試

(爆笑貼圖) http://explodephoto.lookforu.net/ 
(爆笑酷圖) http://coolphoto.withhopes.com/
(愛情遊戲) http://lovegame.dunucry.com/
(精彩視頻) http://wellvideo.upgradelord.com/
(動新聞)    http://donewspaper.lastfriend.net/
(短片分享站) http://videoshare.love2funnyshare.com/
(愛情合約) http://lovecontract.ilovefunnyshare.com/


步驟1:(我不用按讚也能看)  <--- 對我按滑鼠 右鍵 加入到我的最愛
步驟2:進入 爆笑酷X 後,點擊 剛剛加入的  我的最愛.
步驟3:會跳出小視窗,直接按 X

原本的畫面

變成


[Excel] C# OleDB 連線 Excel 資料檢視 (自訂檢視 欄位、條件)

 本篇是 簡介 以 OleDb 來連線至 Excel 檔案 ,並取得資料


點我下載 範例 使用(Source Code)

主要動作:
1.)以 OleDB 連線
2.)取得 分頁表 名稱
3.)SQL 語法取得資料
4.)綁定至 UI

2011年11月22日 星期二

[C#] 將 Dictionary 內資料 綁定至 ComboBox


將容器 Dictionary 內資料,綁定至 ComboBox 內

//宣告變數
            private Dictionary<string, string> Lang = new Dictionary<string, string>();

//使用
            //先清空,然後增加資料
            Lang.Clear();
            Lang.Add("zh-CHT","Chinese (Traditional)");
            Lang.Add("en", "English");
            Lang.Add("ja","Japanese");

            //資料綁定
            cmbT.DataSource = new BindingSource(Lang, null);
            cmbT.DisplayMember = "value";
            cmbT.ValueMember = "key";
            cmbT.SelectedIndex = 0;




[C#] 運用微軟API 線上翻譯

因為之前 Google 線上翻譯 API 常常無法連線,所以使用 Microsoft TransLate API
來進行翻譯,採用 SOAP 方式來實做,能自動判斷要翻譯的文字 是哪一國語言
,再搭配 熱鍵 的註冊 使用,很方便。


按我下載測試使用


//申請開發者ID
請至 Bing API  這裡 登入帳號密碼,點選 開發人員 --> 點選 Add 新增  Application
填入各項 必要資訊後,會拿到1組 Application ID (把這個ID紀錄起來)

//MSDN參考資料
這裡 有提供相關 使用方式。

//建立專案, 並加入 Web 參考(Web Service)

//使用
string res = Km.Translate("剛剛申請的AppID", "要翻譯的文字", "來源文字語系", "要翻譯的語系", "text/html", "general");

一行就搞定,試試看吧!

目前功能:
1.)會自動判斷 要翻譯的文字語系。
2.)支援熱鍵 Ctrl + Q ,將要翻譯的文字反白選擇後,按熱鍵會自動翻譯。
3.)翻譯結果 僅支援 繁體中文、英文、日文

2011年11月18日 星期五

[C#] 讓電腦說話 Speech SDK

在製造現場作業 工作站裡,每個作業操作流程 都會產生 通知訊息
例如: OK  、NG、混料 、作業No 錯誤 .. 等等

先前的作法是,依據 各個訊息 錄製對應的 Wav 檔案來播放
目前嘗試使用 SDK 來自動播放語音。

若安裝 基本SDK 只能播放 英文語音,若要 念中文 則需要額外安裝 LangPack


//引用
using SpeechLib;

//使用
        private void button1_Click(object sender, EventArgs e)
        {
            SpeechVoiceSpeakFlags SP = SpeechVoiceSpeakFlags.SVSFlagsAsync;
            SpVoice Voice = new SpVoice();
            Voice.AllowAudioOutputFormatChangesOnNextSet = true;
            Voice.Rate = -3; // 速度 +- 100
            Voice.Volume = 100; //音量 0~100
            Voice.Speak("Good Job", SP);  //念出 Good Job
        }



下載 範例 Source Code  檔案




Quick links

The links in this section correspond to files available for this download.
Download the files appropriate for you.
File NameSize
msttss22L.exe1.0 MBDownload
sapi.chm2.0 MBDownload
Sp5TTIntXP.exe3.0 MBDownload
SpeechSDK51.exe67.0 MBDownload
SpeechSDK51LangPack.exe81.0 MBDownload
SpeechSDK51MSM.exe131.0 MBDownload

Important File Download Details
  • If you want to download sample code, documentation, SAPI, and the U.S. English Speech engines for development purposes, download the Speech SDK 5.1 file (SpeechSDK51.exe).

  • If you want to use the Japanese and Simplified Chinese engines for development purposes, download the Speech SDK 5.1 Language Pack file (SpeechSDK51LangPack.exe) in addition to the Speech SDK 5.1 file.

  • If you want to redistribute the Speech API and/or the Speech engines to integrate and ship as a part of your product, download the Speech 5.1 SDK Redistributables file (SpeechSDK51MSM.exe).

  • If you want to get only the Mike and Mary voices redistributable for Windows XP, download Mike and Mary redistributables (Sp5TTIntXP.exe).

  • If you only want the documentation, download the Documentation file (sapi.chm).