2021年2月23日 星期二
2021年2月21日 星期日
Views
解決table 內的class 樣式會不見
如果要避免嵌入的CKEditor會自動變更我們設定好的樣式,要在config.js內設定相關屬性,其中config.allowedContent=true。但是因資安疑慮,所以相關設定config.allowedContent=false ,但要多一個標籤設定
config.extraAllowedContent='figure; figcaption; caption; div(*); p(*); span(*); blockquote(*);table(*)';
table(*)表示可以接受table內添加屬性
2021年2月18日 星期四
2021年1月27日 星期三
2021年1月23日 星期六
2020年12月24日 星期四
Views
C# Console搭配工作排程練習
1.開啟vs 2019 console專案
開啟console專案,裡面內容只要能夠自動在每一分鐘內在D:\MyFile入徑下,建立一個txt檔案,且寫入內容,Program.cs的內容為以下
class Program { static void Main(string[] args) <br/>{ string path = @"D:\MyFile\MyTest"+ DateTime.Now.Ticks.ToString() + ".txt"; try { // Create the file using (FileStream fs = File.Create(path)) { byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file."); // Add some information to the file. fs.Write(info, 0, info.Length); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } }
2.window 10 工作排程器使用
這個練習的重點會在工作排程器的使用
(1)打開工作排程器
記得要選取的是.Net的exe執行檔案
在上圖中按下右鍵後啟用,排程就可以成功執行了。
3.預期結果
最後在D:\Myfilex路徑內,就可以看到每一分中自動寫入的.txt檔案
4.參考資料
訂閱:
文章 (Atom)











