2021-2022-1 20211418 《信息安全專業導論》第十一周學習總結
作業信息
[2021-2022-1信息安全專業導論](https://edu.cnblogs.com/campus/besti/2021-2022-1fois)
[2021-2022-1信息安全專業導論第十一周作業](2021-2022-1 《信息安全專業導論》教學進程 - 婁老師 - 博客園 (cnblogs.com))
教材學習內容總結
- 閱讀《計算機科學概論》第15,16章(網絡、萬維網),了解了計算機網絡相關的核心問題,各種類型的網絡和他們的特征,局域網的各種拓撲,用開放式系統實現網絡技術,家庭Internet連接的各種技術,包交換,網絡協議的基本職責,防火墻的功能,主機名和IP地址,域名系統,云計算及其優勢,萬維網的概念,web處理,HTML和XML文檔,JAVA,DTD等內容。
- 閱讀《看漫畫學Python》第14章(網絡通信),了解了基礎的網絡硬件軟件知識,自己學習安裝了JDK, Apache Tomcat等并嘗試自己進行相關設置,并學習了在Python中調用互聯網資源。
教材學習中的問題和解決過程
問題1: Internet和Web的區別?
問題1解決方案: 通過閱讀第十五、十六章,比較兩者概念,知道計算機網絡是為了通信和共享資源而連接在一起的一組計算設備,而萬維網是信息和用于訪問信息的網絡軟件的基礎設施,萬維網是個相對較新的概念。
代碼調試過程中的問題和解決過程
問題1: 出現錯誤信息:
發生異常: URLError
<urlopen error [WinError 10061] 由于目標計算機積極拒絕,無法連接。>
During handling of the above exception, another exception occurred: File "E:\學習\編程\Python\14.3.1發送GET請求.py", line 6, in
問題1解決方案: 在網上查找資料,雖然尚未解決,但是初步判斷是計算機設置問題:
solution 1: 在瀏覽器代理設置中,將局域網設置中將代理服務器取消選中
solution 2: 在瀏覽器代理設置中將自動檢測打開,設置–>代理設置–>彈出Internet屬性–>局域網設置–>自動檢測設置–>重新運行
solution 3: 我的問題是在上網的時候關閉了Http代理,打開全局代理即可。
————————————————
版權聲明:本文為CSDN博主「買貓咪的小魚干」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/weixin_43360896/article/details/111869033
代碼托管
import urllib.request
url = 'http://localhost:8080/NoteWebService/note.do?action=query&ID=10'
req = urllib.request.Request(url)
with urllib.request.urlopen(req) as response:
data = response.read()
json_data = data.decode()
print(json_data)
import urllib.request
url = 'http://localhost:8080/NoteWebService/note.do?action=query&ID=10'
req = urllib.request.Request(url)
with urllib.request.urlopen(req) as response:
data = response.read()
json_data = data.decode()
print(json_data)
import urllib.request
import json
url = 'http://localhost:8080/NoteWebService/note.do?action=query&ID=10'
req = urllib.request.Request(url)
with urllib.request.urlopen(req) as response:
data = response.read()
json_data = data.decode()
print('JSON字符串: ',json_data)
py_dict = json.loads(json_data)
print('備忘錄ID: ',py_dict['ID'])
print('備忘錄日期: ',py_dict['CDate'])
print('備忘錄內容: ',py_dict['Content'])
print('用戶ID: ',py_dict['UserID'])
import threading
import time
import urllib.request
isrunning = True
def workthread_body():
while isrunning:
print("工作線程執行下載任務...")
download()
time.sleep(5)
print("工作線程結束。")
def controlthread_body():
global isrunning
while isrunning:
command = input("請輸入停止指令: ")
if command == 'exit':
isrunning = False
print("控制線程結束。")
def download():
url = 'http://localhost:8080/NoteWebService/logo.png'
req = urllib.request.Request(url)
with urllib.request.urlopen(url) as response:
data = response.read()
f_name = 'download.png'
with open(f_name,'wb') as f:
f.write(data)
print("下載文件成功")
workthread = threading.Thread(target = workthread_body)
workthread.start()
controlthread = threading.Thread(target=controlthread_body)
controlthread.start()
import urllib.request
import json
url = 'http://localhost:8080/NoteWebService/note.do?action=query&ID=10'
req = urllib.request.Request(url)
with urllib.request.urlopen(req) as response:
data = response.read()
json_data = data.decode()
py_dict = json.loads(json_data)
record_array = py_dict['Record']
for record_obj in record_array:
print("————————————備忘錄記錄————————————")
print('備忘錄ID: ',py_dict['ID'])
print('備忘錄日期: ',py_dict['CDate'])
print('備忘錄內容: ',py_dict['Content'])
print('用戶ID: ',py_dict['UserID'])
上周考試錯題總結
暫無。
其他
近期學習時間較緊,還需要增加學習消化時間。
學習進度條
| | 代碼行數(新增/累積)| 博客量(新增/累積)|學習時間(新增/累積)|重要成長|
| 第一周 | 200/200 | 2/2 | 20/20 | |
| 第二周 | 200/400 | 2/4 | 20/40 |
|
| 第三周 | 200/600 | 2/6 | 20/60 |
|
| 第四周 | 200/800 | 2/8 | 20/80 |
|
| 第五周 | 200/1000 | 2/10 | 20/100 | |
| 第六周 | 200/1200 | 1/11 | 20/120 | |
| 第七周 | 200/1400 | 1/12 | 20/140 | |
| 第八周 | 200/1600 | 1/13 | 20/160 | |
| 第九周 | 200/1800 | 3/16 | 20/180 | |
| 第十周 | 200/2000 | 1/17 | 20/200 | |
| 第十一周 | 200/2200 | 1/18 | 20/220 |
參考資料
《計算機科學概論》《看漫畫學Python》
posted on
浙公網安備 33010602011771號