Mini C# Lab 1.4 Release
The primary new feature of Ver 1.4 is batch mode!
Now you can run Mini C# Lab program as a scheduled task, no UI interactivity is needed. Here are some batch argument examples:
- Load and execute x:\temp\test.cs, use the output to overwrie x:\temp\log.txt
MiniCSharpLab /batch /cs:x:\temp\test.cs /out:x:\temp\log.txt /overwrite - Load and execute "c:\some path\test.cs", append the output to LogyyyyMMdd.txt (the file name will be change according to System.DateTime.Now)
MiniCSharpLab /batch /cs:""c:\some path\test.cs"" /out:Log{yyyyMMdd}.txt - Load and execute x:\aa.cs, append the output to x:\aa.txt, if execution time is longer than 1200 seconds, program will be terminated.
MiniCSharpLab /batch /cs:x:\aa.cs /out:x:\aa.txt /timeout:1200 - Load and execute x:\aa.vb as .NET 3.5 program, append the output to x:\aa.txt
MiniCSharpLab /batch /vb:x:\aa.vb /out:x:\aa.txt /v35
There are also minor bug fix and improvement:
- Fix: Thread.Sleep for 0.5" after execution to avoid output loss (I hope it works)
- Add: Add execution duration display
【中文說明】
其實1.4版已經寫出來蠻久了,上回的黑暗盃程式魔人賽裡就已經偷跑過了。今天剛好跟同事提到要寫簡單的Script跑排程,索性一不做二不休,把它Release到CodePlex網站上,想參考程式的人也可以在CodePlex找到原始碼。
1.4版最大的特色是支援批次無UI的方式執行,這個之前網友Ammon也有提過,剛好也是我自己不少排程作業上的需求。執行參數如下:
- 載入並執行x:\temp\test.cs, 輸出結果覆寫到x:\temp\log.txt
MiniCSharpLab /batch /cs:x:\temp\test.cs /out:x:\temp\log.txt /overwrite - 載入並執行"c:\some path\test.cs", 輸入結果附加到LogyyyyMMdd.txt檔案後端(檔名會隨執行時間變化)
MiniCSharpLab /batch /cs:""c:\some path\test.cs"" /out:Log{yyyyMMdd}.txt - 載入並執行x:\aa.cs, 輸出結果附加到x:\aa.txt。若執行時間超過1200秒,會被強制中止
MiniCSharpLab /batch /cs:x:\aa.cs /out:x:\aa.txt /timeout:1200 - 載入x:\aa.vb,視為.NET 3.5程式執行,輸出結果附加到x:\aa.txt
MiniCSharpLab /batch /vb:x:\aa.vb /out:x:\aa.txt /v35
另外還有兩個小修改:
修正: 加入0.5秒Thread.Sleep延遲,防止輸出結果遺失(希望有效) 加入執行時間顯示功能 如發現Bug或有功能建議,歡迎在此留言回饋。(但不一定能即時修正或擴充,請見諒!)