2012年6月9日 星期六

隨機產生資料

;設定資料元素
Dim $D[65] = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","@","-","_"]
$tarFile = "C:\test.txt" ;設定檔案位址
$srcOpen = FileOpen($tarFile,1) ;開啟檔案

 While 1
;一行產生12個字元
For $My = 0 to 12
  
     Random(0,64,1)
  ;寫入檔案。
     FileWrite($srcOpen,$D[Random(0,64,1)] )
  
Next
;換行
    FileWrite($srcOpen,@CRLF)
WEnd
;關閉檔案
Fileclose($srcOpen)

沒有留言:

張貼留言

Ubuntu-Journalctl查看系統日誌

 近期所使用Ubuntu系統24小時開著,進行跑Python程式使用,但跑個2~3天,排程就無法正常寄信,SSH連線也無法正常連線,經查看後為wifi連線問題,暫先使用腳本排程進行重開wifi。 以下為記錄Journalctl指令。 使用Journalctl來從系統日誌上查看看問...