2018/5/10

不一樣的故事就此展開 !

已經有兩年沒來更新網址了~~
Abe2k 你過的還好嗎?
你的成長還在繼續嗎?


2016/11/25

移動 Outlook2013 OST等檔案到非C槽, 以釋出C槽空間。

Step.1

Copy "C:\Users\(登入名稱)\AppData\Local\Microsoft\Outlook" 至 "D:\DirJunction\Outlook"

Step.2

Rename "C:\Users\(登入名稱)\AppData\Local\Microsoft\Outlook" 為 "Outlook_"

Step.3

mklink "C:\Users\(登入名稱)\AppData\Local\Microsoft\Outlook" "D:\DirJunction\Outlook"

Step.4

    Step4.1  開啟Outlook , 檢查是否正常開啟
    Step4.2  檢視 D:\DirJunction\Outlook 檔案修改時間是否可正常修改。表示Outlook 已讀取新位置檔案
    Step4.3  檢視 C:\Users\(登入名稱)\AppData\Local\Microsoft\Outlook 檔案修改時間已沒有變動。表示Outlook 已不再讀取舊檔案位置。

Step.5

確認無誤後。刪除原C槽資料夾資料。(危險)
Delete "C:\Users\(登入名稱)\AppData\Local\Microsoft\Outlook_" 檔案夾。
釋放C槽空間。

2014/11/25

Get Windows account by NodeJS with Nope-SSPI


  1. Install nodeJS application.
  2. Install nodeJS module
    1.  npm install express@3.4.3
    2.  npm install node-sspi
  3. Create a app.js file
  4. Exec the app.js file
  5. Open IE or Chrome Browser then browser the url "http:\\localhost:3000 "


Reference:  https://www.npmjs.org/package/node-sspi

NodeJS Reading List

陸續補充中....

Authentication

User Authentication With Passport.js
http://mherman.org/blog/2013/11/11/user-authentication-with-passport-dot-js/#.VHMEutKUffI

passport-windowsauth
https://www.npmjs.org/package/passport-windowsauth

◎Windows SSPI server-side authentication for Node
https://www.npmjs.org/package/node-sspi
The SSPI will get the client user windows account by IE or Chrome.
But needed express@3.4.4 (the latest version will compile error.)
 [more code...]

Authorize

cansecurity
https://www.npmjs.org/package/cansecurity


Mail helper

nodemailer

2014/11/21

Mongoose shutdown immediately when start it on Window, exec "mongod --repair" on Mongoose\Bin .

Shutdown message:
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.


Mongoose shutdown immediately when start it on Window,
exec "mongod --repair" on  '~Mongoose\Bin '.
Then restart mongod service.




2014/8/12

System.ArgumentException: The specified string is not in the form required for a subject.(指定字串不在主旨的必要表單中)

當操作.Net 寄信時, 若信件主旨會隨 User KeyIn 資料而有所變動時,
以上狀況就有可能發生了.

發生原因為:
      信件主旨中含有 (\r) 或 (\n) 的狀況~~慘遭Mail Server 退信.

報錯:




解決辦法:
    置換 寄信當下的主旨內容

             this._mailsubject = subject.Replace("\r", "").Replace("\n", "");


2013/12/2

資料類型優先順序 Data Type Precedence (Transact-SQL)

當一個運算子結合兩個不同資料類型的運算式時,資料類型優先順序的規則,會指定將低優先順序的資料類型,轉換為高優先順序的資料類型。 如果轉換不是支援的隱含轉換,就會傳回錯誤。 如果這兩個運算元運算式的資料類型相同,則作業結果就含有該資料類型。

eg. Table [T1] 有 Column [C1] 設計為 varchar, 存放數字資料
      比對條件下 select * from T1 where c1 = 1
      SQL Server 需先將 C1 欄位都先轉型成int (此時也有可能發生轉型失敗)才進行比對.


SQL Server 會使用下列資料類型優先順序:

  1.     使用者自訂資料類型 (最高)
  2.     sql_varian t
  3.     xml
  4.     datetimeoffset
  5.     datetime2
  6.     datetime
  7.     smalldatetime
  8.     date
  9.     time
  10.     float
  11.     real
  12.     decimal
  13.     money
  14.     smallmoney
  15.     bigint
  16.     int
  17.     smallint
  18.     tinyint
  19.     bit
  20.     ntext
  21.     text
  22.     image
  23.     timestamp
  24.     uniqueidentifier
  25.     nvarchar (包括 nvarchar(max) )
  26.     nchar
  27.     varchar (包括 varchar(max) )
  28.     char
  29.     varbinary (包括 varbinary(max) )
  30.     binary (最低)

2013/7/24

updatepanel 回傳檔案

UpdatePanel 若使用 <asp:AsyncPostBackTrigger > 回傳檔案(Response.WriteFile)會失效。
可改用<asp:PostBackTrigger 使用。

PS.
Response.Write 需自製HTTP Header 


if (CurrentPage.Request.Browser.Browser.ToUpper() == "IE")
 {
   CurrentPage.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8));

 } else
 {
 CurrentPage.Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName); 


 CurrentPage.Response.BinaryWrite(ms.ToArray()); 
 //CurrentPage.Response.WriteFile(File);

2013/6/25

10進位換算

工作上常遇到需要把資料為到EXCEL中, 這時候計算EXCEL的欄位位置就變成粉繁瑣的一件事了。 利用以下得程式碼,可以輕鬆幫你把EXCEL 中的欄位26進位 換算 成10 進位。 當然 10進味換成26進位也是必要的。 或是你想勇各式各樣奇怪的符號表示個數字亦可以自己new ~~