2020年12月17日 星期四

2020年12月13日 星期日

檔案上傳平台

功能說明
  • 支援Office文件、PDF上傳及常見圖片檔案(JPG、JPEG、GIF、PNG等)
  • 最大100MB
  • 在後台寫個BAT檔案做排程,每天自動檢查已保留3天的檔案自動刪除
  • 避免被上傳病毒,同時可以保護使用者的隱私

使用說明

  1. 上傳您準備要報告的文檔(支援Office常見格式Word/Excel/PPT/OpenDocument Format/PDF)
  2. 確認您的文檔大小<=100MB
  3. 上傳後,伺服器會自動生成一個亂數檔案名稱,請將其複製下,貼回您的掌上電腦,或筆記本電腦(切記:因站長忙碌,沒有協助確認文檔名稱的服務,但規劃未來會提供會員查詢功能。)
  4. 在您要報告的電腦上鍵入網址:http://mark.nkust.cc/upload/uploads/[文檔名].[副檔名](請自行修改為當時複製下的亂數文檔名稱,始可下載。)

Share:

2020年10月22日 星期四

文章列表

Share:

2020年10月13日 星期二

Flutter建置日記2

 對話紀錄

I was also tackling the same issue for an entire day. I searched on StackOverflow, GitHub, Medium and other sites to find the solution to this problem but the thing that worked for me was uninstalling Java JDK version 14 and reinstalling JDK version 8.
I don't want anyone to go through the same issue so I'm posting the detailed solution that worked for me.

When I executed the flutter doctor command in my CMD, the doctor showed me these summaries.


I tried to run flutter doctor --android-licenses and sdkmanager --licenses to accept the license agreement but after executing both threw the same exception.


I also tried to revert back my Java installation but that created a total mess for me.

These are the Android Studio SDKs that I've installed. I've read in many articles and threads that API level 29 Android 10.0 (Q) must be installed so I downloaded it and the physical device I've connected to is running Android 9 (Pie) so I've downloaded that as well.


I've downloaded and installed these SDK tools.


After that, I've uninstalled my Java JDK version 14 installation and installed JDK version 8 and set the JAVA_HOME and PATH environmental variables and restarted my PC.
By doing so the flutter doctor showed these summaries.


After running flutter doctor --android-licenses it showed these summaries.


All these steps worked for me.




Share:

Flutter 建置日記

 Flutter 建置日記

這次所使用的是高科校務通放在Github的檔案,開放讓開發者能夠提供修正參考的管道,這兩天我的電腦發生新建Flutter專案時會導致專案無法建立,跑了一個小時還沒跑完。
索性去讓Android Studio(以下簡稱AS)重新建立Flutter子資料夾,發現它安裝的檔案許多是flutter.dev上面未提供的,因此,直接讓軟體幫我重新設定是最快的方式,期間大概只花了幾分鐘,搞定之後,只要幾秒鐘就可以快速新建一個新專案。
1. 首先,我需要的軟體有AS,並且需要有Flutter相關的先備知識(它是一個能夠支援小綠人跟咬一口雙平台的套件)
2. 再來,進入AS的初始畫面後,在右下角齒輪(Configure)中打開Settings/Plugins,並且安裝Flutter跟Dart兩個套件。
3. 回到主畫面後,點選建立Flutter專案。
4. 接下來是最麻煩也是最需要耐心的部分,就是它需要抓到你放Flutter套件的資料夾,這邊建議不要用網頁上下載下來解壓縮的,在新增檔案時直接建立在C磁碟機或你想要的位置即可。
5. 在這裡,我預設建立的版本是Flutter Application,
6. 依序輸入Project Name、Flutter SDK Path、Project Location、Description等資訊
其中,Flutter SDK Path如果之前您都沒有安裝過的話,它右邊有一個Install的按鈕,就直接按下去,他會幫您下載您需要的所有套件包,以上幾項確定沒有問題之後就可以繼續下一步驟,之後如需重複建立專案,只需重新指向這個已經建立好的套件包就好。
7. Enjoy editing your project!!
到此,導覽告一段落
因部落格尚未建立,所以先貼文在這邊。給有興趣的夥伴參考。
By the way,如果之後想要將軟體回復到初始值的話,只需刪除兩個資料夾即可,如下:
1.刪​​除c盤下的設定檔,路徑為C:\Users \用戶名\ .AndroidStudioX.X和C:\ Users \用戶名\ .android兩個資料夾
2.重新打開Android Studio
Share:

2020年10月11日 星期日

校務通開發序章--登入邏輯

 參考網頁:文藻外語大學校務系統

可以懂邏輯

1.         首先,先導入PY程式所需要的套件,

2.         再來,連入文藻校務系統的鏈結

3.         針對驗證碼解析做CAPTCHA轉換

4.         (第四段不懂用意—def get_md5(data: bytes))

5.         使用MD5取得root權限

6.         核對圖片驗證碼請求

7.         如果login_page_request.status_code200則回傳錯誤(False)

8.         比對正確性

9.         連入放置學生教職員帳號密碼的資料庫,比對本人的帳密有無錯誤

10.     如果狀態為302則代表登入成功

11.     印出登入狀態、登入請求狀態

 

以上大概解釋,如果有錯請學長指導

 

 

我可能變數命名比較辣雞一點

__main__那開始

requests這一個套件有 session 這功能

會自己做好cookie 管理

 

get_md5  這一個是計算md5function

輸入是bytes  原則上是輸入圖片的bytes

 

我這邊的root 是指 DOM root

我這邊是用lxml.etree去解析html

一般學爬蟲比較會看到beautifulsoup

 

流程

先請求login.htm 的頁面資訊 (對方也會給我cookie 這裡 requests.session處理掉了 )

 

拿這個頁面的html get_captcha_text

 

把這個html中的 驗證碼網址給parse 出來

parse 之後 再拿session get 圖片檔案

同時在把圖片檔案(bytes) get_md5    再拿剛剛那個表 就能知道這張圖片是哪一個字母了

 

接下來就是拿SYSTEM_MAGICNUMBER

這一個就只是在login.htm   直接透過lxml.etree 去解析 (我解析都用Xpath)

 

 

最後就是向loginprocess 去登入

他們登入成功是給302


Share:

2020年10月10日 星期六