{"id":2246,"date":"2012-09-15T15:04:41","date_gmt":"2012-09-15T19:04:41","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=2246"},"modified":"2012-10-05T15:08:42","modified_gmt":"2012-10-05T19:08:42","slug":"list-directory-content-with-bulleted-list-hyperlink-vb-net","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2012\/09\/list-directory-content-with-bulleted-list-hyperlink-vb-net\/","title":{"rendered":"List Directory Content with Bulleted List Hyperlink &#8211; VB.NET"},"content":{"rendered":"<pre>\r\nCode Behind\r\n<code>\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_Website\\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     'bind url to line item - create hyperlink\r\n      Dim LnItem = New ListItem(FInfo.ToString, \"http:\/\/www.mywebsiteurl.com\/\" +\r\n                                                 My_Folder\/\" & FInfo.ToString)\r\n      'create bulleted list\r\n      BulletedList1.Items.Add(LnItem)\r\n      'open url in new window\r\n      BulletedList1.Target = \"_blank\"\r\n    Next\r\n        \r\nEnd Sub\r\n<\/code>\r\nMarkup page\r\n<code>\r\n&lt;form id=\"form1\" runat=\"server\">\r\n  &lt;div style=\"padding-left: 20px;\">\r\n\r\n   &lt;asp:bulletedlist ID=\"BulletedList1\" runat=\"server\" DisplayMode=\"HyperLink\" >\r\n   &lt;\/asp:bulletedlist>\r\n\r\n   &lt;\/div>\r\n &lt;\/form><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Code Behind Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) &#8216; make a reference to a directory Dim DirPath As New IO.DirectoryInfo(&#8220;C:\\\\My_Website\\My_Folder&#8221;) Dim FCollect As IO.FileInfo() = DirPath.GetFiles() Dim FInfo As IO.FileInfo &#8216;list the names of all files in the specified directory For Each FInfo In FCollect &#8216;bind url to line item &#8211; [&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,52,84],"tags":[19,115,116,21],"class_list":["post-2246","post","type-post","status-publish","format-standard","hentry","category-net-4-0","category-applications","category-controls","category-vs2010","tag-asp-net","tag-bulleted","tag-list","tag-visual-studio"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2246"}],"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=2246"}],"version-history":[{"count":6,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2246\/revisions"}],"predecessor-version":[{"id":2252,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2246\/revisions\/2252"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=2246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=2246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=2246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}