c++編寫托管dll_教程:如何編寫簡單的網站并免費托管

c++編寫托管dll

本教程適用于誰? (Who is this tutorial for?)

  • This tutorial assumes no prior knowledge and is suitable for complete beginners as a first project

    本教程假定您沒有先驗知識,并且適合初學者作為第一個項目

您將需要什么 (What you will need)

  • a GitHub account (if you already have one set up, skip step 1)

    一個GitHub帳戶(如果已經設置了一個帳戶,請跳過步驟1)

  • a Netlify account

    一個Netlify帳戶
  • a code editor (for this tutorial I used Visual Studio Code)

    一個代碼編輯器(對于本教程,我使用了Visual Studio Code )

  • terminal app

    終端應用
  • approximately 1–2 hour

    大約1-2小時

讓我們開始吧! (Let’s get started!)

步驟1:注冊GitHub帳戶。 (Step 1: Sign up for a GitHub account.)

Image for post

What exactly is GitHub? The Git in GitHub is a version control system, so that every time anything changes in our code, that change is tracked. This lets you trace everything you’ve ever written and changed within a project and revert back to an old version of your code if you need to. Git on its own is a command-line tool. GitHub is where it all comes together. It’s where we can store our projects, track all our work and code changes, as well as network with other developers (and check out their projects!).

GitHub到底是什么? GitHub中的Git是一個版本控制系統,因此每當我們的代碼中發生任何更改時,都會跟蹤該更改。 這樣,您就可以跟蹤您在項目中編寫和更改的所有內容,并在需要時還原為舊版本的代碼。 Git本身就是一個命令行工具。 GitHub是所有功能的結合體。 在這里,我們可以存儲我們的項目,跟蹤我們的所有工作和代碼更改,以及與其他開發人員建立聯系(并檢查他們的項目!)。

步驟2:建立新的GitHub存放區 (Step 2: Create a new GitHub repository)

Image for post

It’s good practice to initialize your project with a README file. In this file, you can put some information about your project so that anyone who is interested can understand what the project is and how to make sense of the project files.

最好使用README文件初始化項目。 在此文件中,您可以放入有關項目的一些信息,以便任何感興趣的人都可以了解項目是什么以及如何理解項目文件。

步驟3:將存儲庫克隆到計算機上 (Step 3: Clone your repository on to your computer)

Image for post
  • Click on “Clone or download” and copy the HTTPS URL

    單擊“克隆或下載”并復制HTTPS URL
  • Open up your terminal (on a mac just hit the search icon and type Terminal)

    打開終端(在Mac上,只需點擊搜索圖標,然后輸入Terminal )

Image for post

The Terminal is the interface to the underlying operating system of our computer. It is a command line. From here we can do a bunch of cool things. But for now, let’s navigate to where we want to keep our project files and make a “clone” of the repository that we just created on GitHub.

終端是計算機底層操作系統的接口。 這是一個命令行。 從這里我們可以做很多很酷的事情 。 但是現在,讓我們導航到要保留項目文件的位置,并對剛剛在GitHub上創建的存儲庫進行“克隆”。

Give it a go with the following commands:

嘗試以下命令:

$ pwd

This stands for print working directory. As you can see above, it will show you where you are within your files.

這代表打印工作目錄。 如上所示,它將顯示文件中的位置。

$ ls

This one will give you a list of all the directories and files within your current directory. It stands for short listing as it only gives you the name of the file or directory.

這將為您提供當前目錄中所有目錄和文件的列表。 它代表簡短清單 ,因為它只為您提供文件或目錄的名稱。

To learn more terminal commands, check out this cheat sheet.

要了解更多終端命令,請查看此備忘單 。

Let's create a directory for our project

讓我們為項目創建一個目錄

Image for post

Use the following commands to create a new directory and clone your project

使用以下命令創建新目錄并克隆您的項目

$ cd Documents
$ git clone <HTTPS URL from your GitHub repository>
$ cd <name of your project repository>
$ ls

Now we have a new directory, mine is called tutorial-website, and within this directory, we can type “ls” to see that we have our README file.

現在,我們有了一個新目錄,我的目錄稱為tutorial-website,在該目錄中,我們可以鍵入“ ls”以查看我們是否有README文件。

步驟4:打開代碼編輯器并創建項目文件 (Step 4 : Open your code editor and create your project files)

There are lots of different code editors and everyone has their personal preferences. For this tutorial, I will use Visual Studio Code. It’s free, it’s simple, it’s good. You can download it here.

有許多不同的代碼編輯器,每個人都有自己的個人喜好。 在本教程中,我將使用Visual Studio Code。 它是免費的,它很簡單,很好。 您可以在此處下載。

  • Let’s launch VS code and open our project

    讓我們啟動VS代碼并打開我們的項目
Image for post

So far we only have our README file. Let’s go to our terminal and create 2 new files, one will be our HTML file and the other will be the CSS file.

到目前為止,我們只有README文件。 讓我們轉到終端并創建2個新文件,一個是我們HTML文件,另一個是CSS文件。

$ ls (to make sure you are still in the right directory)
$ touch index.html
$ touch style.css

The touch command followed by the name of our file is how we can create a new file. Now let’s go back to VS code and see our files.

緊隨我們文件名之后的touch命令是我們如何創建新文件的方法。 現在,讓我們回到VS代碼并查看我們的文件。

Image for post

Our 2 new files have arrived in our project folder and they are highlighted green so that we know that they are new.

我們的2個新文件已到達項目文件夾,并以綠色突出顯示,因此我們知道它們是新文件。

第5步:編寫一些代碼! (Step 5: Write some code!)

  • let’s open our index.html file and write some code

    讓我們打開index.html文件并編寫一些代碼
<!DOCTYPE html>
<html>
<head>
<title>Tutorial Website</title>
</head>
<body></body>
</html>
  • This boilerplate code is the structure of our Html file. In the <head> tag, we have our meta-data, which is simply information about our website.

    此樣板代碼是我們HTML文件的結構。 在<head>標記中,我們有我們的元數據,這只是有關我們網站的信息。
  • In the <body> tag is where we will write our code to bring our website together

    在<body>標記中,我們將編寫代碼以將我們的網站整合在一起

Let’s put some content in the <body> tag.

讓我們在<body>標簽中添加一些內容。

You can copy and paste the code below of course but I’ve found that the best way to learn how to code when you’re just getting started, is to type everything out!

您當然可以復制和粘貼下面的代碼,但是我發現,剛入門時學習編碼的最佳方法是鍵入所有內容!

<!DOCTYPE html>
<html>
<head>
<title>Tutorial Website</title>
</head>
<body>
<div class="main-container">
<div class="header">
<h1>Tess's Website</h1>
</div>
<div class="main-content">
<img src="portrait-drawing.png"
<p>Hi, my name is Tess and I'm writing a tutorial on how to build and deploy a simple website!</p>
</div>
</div></body>
</html>

I’ve decided to put an image on my website. Make sure to add your image to the project folder and put the file name in the <img> tag.

我決定在我的網站上放一張圖片。 確保將圖像添加到項目文件夾,并將文件名放在<img>標記中。

This is how everything should look at this point:

這是此時一切的樣子:

Image for post

How can we tell if it’s working? Simply open your index.html file with your browser.

我們如何知道它是否有效? 只需使用瀏覽器打開index.html文件。

This is how it’s looking so far:

到目前為止是這樣的:

Image for post

步驟6:添加CSS樣式 (Step 6: Adding CSS styling)

Let’s make it look good! Html is the structure of our page, but CSS is where the magic happens to make it look just how we want it.

讓我們看起來不錯! HTML是頁面的結構,而CSS恰恰是神奇的地方,它使它看起來像我們想要的樣子。

  • Open the style.css file

    打開style.css文件

Let’s write some code

讓我們寫一些代碼

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont,
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
}h1 {
color: pink;
font-size: 100px;
}img {
max-width: 250px;
}.main-container {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}.header {
width: auto;
border-bottom: 3pt solid pink;
padding: 0px 100px;
margin-bottom: 100px;
}.main-content {
display: flex;
justify-content: space-between;
max-width: 800px;
}.main-content p {
font-size: 25px;
margin-left: 30px;
}

This is how our CSS file should look now:

這就是我們CSS文件現在的外觀:

Image for post

Now we need to make sure our CSS file is referenced in our Html file so that our website knows to read the styles we have defined in our CSS file.

現在我們需要確保我們HTML文件中引用了我們CSS文件,以便我們的網站知道讀取我們在CSS文件中定義的樣式。

In our Html file, let’s add some code to our <head> tag.

在我們HTML文件中,讓我們向<head>標簽添加一些代碼。

<!DOCTYPE html>
<html>
<head>
<title>Tutorial Website</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="main-container">
<div class="header">
<h1>Tess's Website</h1>
</div>
<div class="main-content">
<img src="portrait-drawing.png"
<p>Hi, my name is Tess and I'm writing a tutorial on how to build and deploy a simple website!</p>
</div>
</div></body>
</html>

Let’s go ahead and check how everything is looking now in our browser!

讓我們繼續前進,檢查瀏覽器中現在的一切情況!

Image for post

A bit of an improvement!

有點改善!

Step 7: Commit the code to GitHub

步驟7:將代碼提交到GitHub

As you work on your project, it’s important to commit your code to your GitHub repository to make sure that you never lose any of your work. The most common way to work is to commit your code every time you finish a feature.

在您處理項目時,將代碼提交到GitHub存儲庫以確保您不會丟失任何工作非常重要。 最常見的工作方式是在每次完成功能時提交代碼。

Let’s go back to our terminal and commit our code.

讓我們回到終端并提交我們的代碼。

$ git add .
$ git commit -m "write a message here that describes the change you've made to your project files"
$ git push
Image for post

Now we can go to our GitHub repository and our files will be there.

現在,我們可以轉到我們的GitHub存儲庫,我們的文件將在那里。

Image for post

We can see our new files, and we can see the commit message which should include information about the changes we are committing to our project.

我們可以看到我們的新文件,也可以看到提交消息,其中應該包含有關我們提交給項目的更改的信息。

第8步:直播! 讓我們部署我們的網站 (Step 8: Make it live! Let’s deploy our website)

  • Sign up for a Netlify account here

    在此處注冊Netlify帳戶

  • I used my GitHub login to sign-up, makes it easy and quick

    我使用GitHub登錄名進行注冊,因此變得簡單快捷
Image for post

From the landing dashboard, click on “New site from Git”

在著陸儀表板中,單擊“來自Git的新站點”

Select GitHub for continuous deployment

選擇GitHub進行連續部署

Image for post

Chose whether you want to allow Netlify to access all your repositories, or select only specific repositories, and click “install”.

選擇是要允許Netlify訪問您的所有存儲庫,還是僅選擇特定的存儲庫,然后單擊“安裝”。

Image for post

Go back to the Netlify dashboard and select your project repository:

返回到Netlify儀表板并選擇您的項目存儲庫:

Image for post

Double-check the details, and click “Deploy site”

仔細檢查詳細信息,然后單擊“部署站點”

Image for post

We are live baby!

我們是活著的寶貝!

Your URL will consist of a strange generated Netlify domain. Here is the final product: https://mystifying-ride-b035ec.netlify.app/

您的URL將包含一個奇怪的生成的Netlify域。 這是最終產品: https : //mystifying-ride-b035ec.netlify.app/

Image for post

You can also buy a domain name and set up your site to point to your custom domain name by following Netlify’s easy instructions here.

你也可以買一個域名,并通過以下Netlify的簡易說明你的網站點設置到您的自定義域名在這里 。

Here is the final product:

這是最終產品:

Image for post

I hope you enjoyed following this tutorial. The fun part now is to play around with the code and make it your own!

希望您喜歡本教程。 現在最有趣的部分是使用代碼并自己編寫代碼!

Thanks for following along, I hope it was useful!

感謝您的關注,希望它對您有所幫助!

翻譯自: https://uxdesign.cc/how-to-code-a-simple-website-and-host-it-for-free-d3bf8b1bab37

c++編寫托管dll

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/274129.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/274129.shtml
英文地址,請注明出處:http://en.pswp.cn/news/274129.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

淺述WinForm多線程編程與Control.Invoke的應用

在WinForm開發中&#xff0c;我們通常不希望當窗體上點了某個按鈕執行某個業務的時候&#xff0c;窗體就被卡死了&#xff0c;直到該業務執行完畢后才緩過來。一個最直接的方法便是使用多線程。多線程編程的方式在WinForm開發中必不可少。本文介紹在WinForm開發中如何使用多線程…

Android 第五課 常用控件的使用方法(TextView、Button、EditView、 ImageView、 ProgressBar、 ProgressDialog等)

總結&#xff1a;見名知意 TextView&#xff1a; Button: EditView: ImageView: ProgressBar: ProgressDialog和AlertDialog有些類似&#xff0c;都可以再界面彈出對話框&#xff0c;都能夠屏蔽其他控件的交互能力&#xff0c;用法也類似。 我們還發現ProgressDialog和AlertDia…

設計 色彩 構圖 創意_我們可以從時尚的創意方向中學到色彩

設計 色彩 構圖 創意The application of fashion as a form of aesthetic expression is a notion familiar to many. Every day, we curate ourselves with inspiration from rising trends, a perception of our personal preferences, and regards to practicality in the c…

Android 第六課 4種基本布局之LinearLayout和Relativelayout

看完控件&#xff0c;緊接著看布局&#xff0c;布局是可以來放置控件&#xff0c;管理控件的。布局里也可以嵌套布局。我們新建項目UILayoutTest項目&#xff0c;活動名和布局名選擇默認。加入活動及其對應的布局已經創建完成。線性布局(LinearLayout)android:layout_gravity屬…

如何在UI設計中制作完美陰影

重點 (Top highlight)Shadows are everywhere in modern UI Designs. They are one of the most essential part of the UI elements right behind the fill, stroke, and cornder radius. &#x1f609;現代UI設計中到處都有陰影。 它們是UI元素中最重要的部分之一&#xff0c…

微軟2013年校園實習生招聘筆試題及答案

原文&#xff1a; http://www.wangkaimin.com/2013/04/07/%e5%be%ae%e8%bd%af2013%e5%b9%b4%e6%a0%a1%e5%9b%ad%e5%ae%9e%e4%b9%a0%e7%94%9f%e6%8b%9b%e8%81%98%e7%ac%94%e8%af%95%e9%a2%98%e5%8f%8a%e7%ad%94%e6%a1%88/#more-195 1. Which of following calling convension(s)…

Android 第七課 4種基本布局之FrameLayout和百分比布局

FrameLayout&#xff08;幀布局&#xff09;&#xff0c;她沒有方便的定位方式&#xff0c;所有的控件都會默認擺放在布局的左上角。 修改activity_main.xml中的代碼&#xff0c;如下&#xff1a; <?xml version"1.0" encoding"utf-8"?> <Frame…

mongodb 群集圖_群集和重疊條形圖

mongodb 群集圖為什么和如何 (Why & How) 1.- Clustered Bar Charts1.- 集群條形圖 AKA: grouped, side-by-side, multiset [bar charts, bar graphs, column charts]AKA &#xff1a;分組&#xff0c;并排&#xff0c;多組[條形圖&#xff0c;條形圖&#xff0c;柱形圖] …

第一次寫python

這是一個在BJDP上學習Coding Kata的時候用到的一個練習&#xff0c;原來打算用Java寫的&#xff0c;但是一想正好是學習的好機會。 就用Python了。第一次&#xff0c;寫的有些復雜。 這個題目是關于購買圖書的打折信息的。 題目來源&#xff1a; http://codingdojo.org/cgi-bin…

Android 第八課 創建自定義控件

常用控件和布局的繼承結構&#xff0c;如下圖&#xff1a; &#xff08;待續。。。。&#xff09; 所有的控件都是直接或間接繼承自View的&#xff0c;所用的所有布局都是直接或間接繼承自ViewGroup的&#xff0c;View是Android中最基本的一種UI組件&#xff0c;它可以在屏幕上…

figma下載_搬到Figma對我意味著什么

figma下載A couple of years ago, amidst the boom of new design and prototyping software, I was pretty reluctant to fight on the Figma/Sketch cold war. I was working on a relatively small design team and, after years helping to design products, well sold on …

解決IE中img.onload失效的方法

解決IE中img.onload失效的方法 - CoffeeCats IT Blog - IT博客http://www.cnitblog.com/CoffeeCat/archive/2008/02/01/39533.htmlFirefox、Google Chrome不存在問題&#xff01;為什么onload沒有被IE調用呢&#xff1f;因為IE會緩存圖片&#xff0c;第2次加載的圖片&#xff0…

Android 第九課 常用控件-------ListView

ListView允許用戶通過手指上下滑動的方式將屏幕外的數據滾動到屏幕內&#xff0c;同時屏幕上原有數據將會滾動出屏幕。 1、ListView簡單用法 如何將ListView將你要顯示的大量內容關聯起來呢&#xff1f;這是個很重要的問題。 1、首先我們必須先將數據提供好&#xff0c;因為你的…

Singleton patterns 單件(創建型模式)

1、模式分類 1.1 從目的來看&#xff1a; ? – 創建型&#xff08;Creational&#xff09;模式&#xff1a;負責對象創建。 ? – 結構型&#xff08;Structural&#xff09;模式&#xff1a;處理類與對象間的組合。 ? – 行為型&#xff08;Behavioral&…

Android 第十一課 SQlite 數據庫存儲

Android 為了讓我們能夠更加方便的管理數據庫&#xff0c;特意提供了一個SQLiteOpenHelper幫助類&#xff0c;通過借助這個類就可以非常簡單的對數據庫進行創建和升級。 SQLiteOpenHelper是一個抽象類&#xff0c;我們要創建一個自己的幫助類去繼承它。SQLiteOpenHelper有兩個抽…

淺析SQL Server 2005中的主動式通知機制

一、引言 在開發多人同時訪問的Web應用程序&#xff08;其實不只這類程序&#xff09;時&#xff0c;開發人員往往會在緩存策略的設計上狠下功夫。這是因為&#xff0c;如果將這種環境下不常變更的數據臨時存放在應用程序服務器或是用戶機器上的話&#xff0c;可以避免頻繁地往…

Android 第十二課 使用LitePal操作數據庫(記得閱讀最后面的注意事項哦)

一、LitePal簡介 1、(新建項目LitePalTest)正式接觸第一個開源庫---LitePalLitePal是一款開源的Android 數據庫框架&#xff0c;它采用了對象關系映射&#xff08;ORM&#xff09;的模式。2、配置LitePal&#xff0c;編輯app/build.gradle文件&#xff0c;在dependencies閉包中…

listview頻繁刷新報錯

在Android編程中使用Adapter時&#xff0c;偶爾會出現如下錯誤&#xff1a;The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI t…

Android 第十三課 SharedPreferences存儲

SharedPreferences是使用鍵值對的方式來存儲數據的。當保存一條數據時&#xff0c;需要給這條數據提供一個對應的鍵&#xff0c;這樣在讀取數據的時候就可以通過這個鍵把相應的值取出來。而且支SharedPreferences還支持多種不同的數據類型存儲&#xff0c;例如&#xff1a;如果…

DSP的Gel作用

轉自&#xff1a;http://blog.csdn.net/azhgul/article/details/6660960最近剛在研究Davinci系&#xff0c;特此MARK下&#xff0c;以資后續學習之用。 DSP的Gel作用 1 GEL文件基本作用 當CCSStudio啟動時&#xff0c;GEL文件加載到PC機的內存中&#xff0c;如果定義了StartUp(…