- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 457字
- 2021-07-02 15:29:22
Making a directory and creating a file from Command Prompt
Now, you want to make sure that you have the samplefile.txt file. So, to do that in Windows, type cmd, which is short for Command Prompt, and open that. At the C:\> prompt, start by typing cd.. to go up one level and then cd.. again to go up another level. Then enter cd data to change to the data directory. The system responds that this path does not exist, as you can see in Figure 5.5.3; so, we'll have to create the path and make the file:

To create the path, type the following at command prompt:
C:\>md data
Then, enter the following to change into that directory:
C:\>cd data
Next, type the following to show you the list of files in the directory:
C:\data\dir
As you can see in the Figure 5.5.3, there is nothing inside the directory: it's new, we just created it. So, to open a file in Notepad, type the following at the prompt:
C:\data\notepad.exe samplefile.txt
This makes the file. When the screen prompt asks if you want to create a new file, click on the Yes button. This will open a blank Notepad file. Enter some text, as shown in Figure 5.5.4:

Make sure that you save it in the C:\data directory (Ctrl + S) and then you can close it.
Now, take a look. To recall previous commands, you can just press the up arrow key or, in this case, type dir at command prompt as earlier: C:\data\dir. Now you can see that samplefile.txt is present in the directory, as shown in Figure 5.5.5:

Now launch this in your browser, and take a look at the results. Click on the Show button. It's working as expected: it opened both the Notepad file and the Bing home page, as shown in Figure 5.5.6:

You can now launch any browser, a process of some kind, directly from your page and show it and you can open up a file, if you want, directly from a browser.
Also, you can see the listing of the keys, as shown in Figure 5.5.7:

So, these are some of the basics of what you can do with a generic dictionary.
- Flask Web全棧開發實戰
- Mastering SVG
- 編程卓越之道(卷3):軟件工程化
- Offer來了:Java面試核心知識點精講(原理篇)
- Python從入門到精通(精粹版)
- Learning SQLite for iOS
- 人臉識別原理及算法:動態人臉識別系統研究
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- Windows Server 2012 Unified Remote Access Planning and Deployment
- Unity Game Development Scripting
- Learning Concurrent Programming in Scala
- Python算法詳解
- JSP程序設計實例教程(第2版)
- Android應用開發實戰
- Unity 3D UI Essentials