網路城邦
上一篇 回創作列表 下一篇  字體:
Files system part III
2009/03/24 08:46:13瀏覽874|回應58|推薦0

Following we shall use the directoryinfo function to request user to keyin the directory information and the system.io well help the user to find wether the directory exist or not! if it exist then will show up what in that directory! please see the pictures:

and following is the coding:

Imports System.IO
03 Module Module1
05    Sub Main()
06        Console.Write("請輸入路徑->")
07        Dim fpath As String = Console.ReadLine
08        Dim dir As New DirectoryInfo(fpath)
10        If Not dir.Exists Then ‘判斷路徑是否不存在
11            Console.WriteLine("路徑不存在")
12            Console.Read()
13            Return
14        End If
15        Console.WriteLine("{0}資料夾下的子資料夾如下:", dir.FullName)
16        Dim subdir() As DirectoryInfo = dir.GetDirectories
17        For Each r As DirectoryInfo In subdir
18            Console.WriteLine("完整路徑:{0}      {1}建立時間{2}", _
                 r.FullName, vbTab, r.CreationTime)
19        Next
20        Console.Read()
22    End Sub
23 End Module

wish you through this two example can understand how to use system.io!

( 知識學習其他 )
回應 推薦文章 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=yangfu&aid=2776386

 回應文章 頁/共 6 頁  回應文章第一頁 回應文章上一頁 回應文章下一頁 回應文章最後一頁

710108
好了
2009/03/24 11:03

ConsoleApplication1.exe

黃煜峰

40329

710108

夫子(yangfu) 於 2009-03-25 10:34 回覆:
OK! your project build file had been checked!

710101
Files system part III
2009/03/24 10:59

403 22 陳彥君

學號710101

檔名 part2.exe

夫子(yangfu) 於 2009-03-25 10:35 回覆:
要注意你的儲存容量哦!不要超過100MB哦!
your project build file had been checked!

黃楷倫
好了
2009/03/24 10:56

710107

黃楷倫

40328

worklastststs.exe

夫子(yangfu) 於 2009-03-25 10:37 回覆:
網路儲存容量只有100MB哦,別超過了。
I had checked your homework file!

123
456
2009/03/24 10:55

40331廖秦利

學號:710110

檔名:ConsoleApplication1347.exe

夫子(yangfu) 於 2009-03-25 10:43 回覆:
I only request you shall upload your execute file! you don't have to upload the entire project folder! that will waste too many capacity of your network storage! and also let me become more difficult to found the file! so please remember it! when you finished your project use "build" function to export the .exe file and just upload it will do! thank you!

曾郁凱
作業
2009/03/24 10:53

班級403

檔名homework

學號710104

夫子(yangfu) 於 2009-03-25 10:43 回覆:
OK! your project file had been checked!

710066
710066
2009/03/24 10:09

40227

710066

檔名710066-4

楊小萱

夫子(yangfu) 於 2009-03-25 10:45 回覆:
unable to found the file you mention at your post? where had you upload it? can't found it at entire www folder !

710073
作業
2009/03/24 10:03

高一二班

劉碩純

34號

學號:710073

檔名:ConsoleApplication1710073003.exe

夫子(yangfu) 於 2009-03-25 10:48 回覆:
suggest : filename shall not too long! you can made it much shorter !

40225
40225
2009/03/24 09:51

檔名:ConsoleApplication1_new.exe

學號710065

姓名_黃筱葳

班級402

座號25

夫子(yangfu) 於 2009-03-25 10:51 回覆:
you shall use much shorter filename!
頁/共 6 頁  回應文章第一頁 回應文章上一頁 回應文章下一頁 回應文章最後一頁