---
# System prepended metadata

title: c#-1
tags: [資安筆記-c#]

---

---
title: c#-1
tags: 資安筆記-c#
---
老師的教材:teacher.syset.com

---
![](https://i.imgur.com/qXhQorB.png)

---
![](https://i.imgur.com/uuXToDs.png)

---
VSCODE安裝軟體:用CTRL+放大字
確認dotnet是否有裝(要在網址裝):https://dotnet.microsoft.com/download/dotnet-core/3.1

要裝這些-64 位元的連結:


https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.401-windows-x64-installer
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.7-windows-x64-installer
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-3.1.7-windows-x64-installer



裝C#:
![](https://i.imgur.com/Qgtk9gn.png)

CTRL+~開啟終端機
![](https://i.imgur.com/AwFU1Wl.png)


dir整齊才是對的(有的V會亂/有的沒V會亂)
![](https://i.imgur.com/W5p7e7x.png)

---
![](https://i.imgur.com/exkDq4w.png)


---
做MVC程式-
1.先建資料夾C:\Demos\20200824
2.建立專案名稱
![](https://i.imgur.com/BhOsfwV.png)
![](https://i.imgur.com/dPNmpkv.png)

---
在VSCODE開檔案
![](https://i.imgur.com/lJCWvAk.png)
是否debug-YES

---
CTRL+~開啟終端機
dotnet run-開啟網站
![](https://i.imgur.com/xu9m2L3.png)
![](https://i.imgur.com/ztJq0Bw.png)


進階-繼續前往
![](https://i.imgur.com/y4aX6Ti.png)

---
定義要做的東西+網址

![](https://i.imgur.com/LRrizoR.png)
原來自動產生的HomeController.cs
![](https://i.imgur.com/dgXGTxn.png)
程式碼:


複製建一個
DemoController .cs
![](https://i.imgur.com/D13w3Gx.png)


dotnet run 要先CTRL+C完 才能再dotnet run


----
![](https://i.imgur.com/M1YJQUj.png)

![](https://i.imgur.com/4Zp36ZK.png)
![](https://i.imgur.com/C38cklz.png)

建立屬性


---
![](https://i.imgur.com/czOW4oA.png)

---

DEBUG方法:CTRL+~開啟終端機
終端機跑掉了
都在powershell
沒有在dotnet 


----
![](https://i.imgur.com/6D9OOKU.png)
![](https://i.imgur.com/2HfT6Mn.png)

----
有3個檔案(快一點的寫法都是用複製的)
![](https://i.imgur.com/kAKlv6s.png)



https://gist.github.com/jzs2home/5689f1e9b4976cebd0134b574e913181

https://gist.github.com/jzs2home/bce41d06a843dfed6706a938d71b94e3

https://gist.github.com/jzs2home/ef33d52716090fbf095d9c94a3484422

---
cd..回上一層

另外一種寫法-(要編輯模式才看的到)

<html>
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
        <form>
            No1: <input type="text" id="no1" /><br/>
            No2: <input type="text" id="no2" /><br/>
            <input type="button" value="計算" id="btn1" /><br/>
            Answer: <span id="answer"></span>
        </form>
    </body>
</html>



