{"id":2452,"date":"2013-03-07T17:19:13","date_gmt":"2013-03-07T21:19:13","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=2452"},"modified":"2013-03-07T17:19:13","modified_gmt":"2013-03-07T21:19:13","slug":"read-the-content-of-the-folder-vb-net","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2013\/03\/read-the-content-of-the-folder-vb-net\/","title":{"rendered":"Read the content of the folder &#8211; VB.NET"},"content":{"rendered":"<pre>\r\n<code>\r\n&lt;%@ Page Language=\"VB\" %>\r\n\r\n&lt;%@ Import Namespace=\"System\" %>\r\n&lt;%@ Import Namespace=\"System.IO\" %>\r\n&lt;%@ Import Namespace=\"System.IO.FileInfo\" %>\r\n\r\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \r\n   \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">\r\n&lt;style type=\"text\/css\">\r\nul { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; \r\n     font-style: normal; line-height: 25px; font-variant: normal; \r\n     color: #0C4F93; text-indent: 5px; \r\n     list-style-position: outside; list-style-type: square;\r\n   }\r\n\r\n&lt;script runat=\"server\">\r\nProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)\r\n        ' make a reference to a directory\r\n        Dim DirPath As New IO.DirectoryInfo(\"C:\\\\My_Folder\")\r\n        Dim FCollect As IO.FileInfo() = DirPath.GetFiles()\r\n        Dim FInfo As IO.FileInfo\r\n        \r\n        'list the names of all files in the specified directory\r\n        For Each FInfo In FCollect\r\n            Dim LnItem = New ListItem(FInfo.ToString, \r\n             \"http:\/\/my_webstie\/My_Folder\" & FInfo.ToString)\r\n            BulletedList1.Items.Add(LnItem)\r\n            BulletedList1.Target = \"_blank\"\r\n        Next\r\n        \r\n    End Sub\r\n\r\n&lt;\/script>\r\n\r\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\r\n&lt;head runat=\"server\">\r\n&lt;title>List directory\r\n&lt;link href=\"Styles\/Site.css\" rel=\"stylesheet\" type=\"text\/css\" \/>\r\n&lt;\/head>\r\n&lt;body>\r\n&lt;div class=\"page\">\r\n&lt;div class=\"header\">\r\n&lt;div class=\"nav_pos\" >\r\n&lt;div class=\"nav_format\">\r\n&lt;% Response.Write(MonthName(DateTime.Now.Month) & \" \" & DateTime.Now.Day &_\r\n     \", \" & DateTime.Now.Year) %> \r\n    \r\n\r\n&lt;div id='MenuPos' style=\"position:relative;\">\r\n&lt;% Response.WriteFile(\"site_menu\/top_menu.asp\")%>\r\n&lt;\/div>\r\n&lt;\/div>\r\n&lt;fieldset>\r\n&lt;legend>5500 Forms and Summary Annual Reports for 2011\r\n&lt;form id=\"form1\" runat=\"server\">\r\n&lt;div style=\"padding-left: 20px;\">\r\n&lt;asp:bulletedlist ID=\"BulletedList1\" runat=\"server\" \r\nDisplayMode=\"HyperLink\" BulletStyle=\"NotSet\" >\r\n&lt;\/asp:bulletedlist>\r\n&lt;\/div>\r\n&lt;\/form>\r\n&lt;\/fieldset>\r\n&lt;div class=\"footer\">Copyright \u00a9 < %= Date.Today.Year.ToString() %>\r\n - My Website Name\u00ae - All Rights Reserved.\r\n&lt;\/div>\r\n&lt;\/body>\r\n&lt;\/html>\r\n<\/code>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&lt;%@ Page Language=&#8221;VB&#8221; %> &lt;%@ Import Namespace=&#8221;System&#8221; %> &lt;%@ Import Namespace=&#8221;System.IO&#8221; %> &lt;%@ Import Namespace=&#8221;System.IO.FileInfo&#8221; %> &lt;!DOCTYPE html PUBLIC &#8220;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&#8221; &#8220;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&#8221;> &lt;style type=&#8221;text\/css&#8221;> ul { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: 25px; font-variant: normal; color: #0C4F93; text-indent: 5px; list-style-position: outside; list-style-type: square; } &lt;script runat=&#8221;server&#8221;> Protected Sub Page_Load(ByVal [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,17,16,52,84],"tags":[126,129,130],"class_list":["post-2452","post","type-post","status-publish","format-standard","hentry","category-net-4-0","category-applications","category-net","category-controls","category-vs2010","tag-content","tag-display","tag-folder"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2452"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=2452"}],"version-history":[{"count":11,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2452\/revisions"}],"predecessor-version":[{"id":2463,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2452\/revisions\/2463"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=2452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=2452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=2452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}