Hi vereato,
To use the dll for insert update delete you need to add the dll reference in the project.
Then import the namespace in the page you want to access.
Then only all the methods and properties present in the dll can be accessed.
Refer below sample to search directory and subdirectory to load all files in ListView.
HTML
<asp:ListView runat="server" ID="lvFiles">
<ItemTemplate>
<%#Eval("Text") %>
<hr />
</ItemTemplate>
</asp:ListView>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string path = Server.MapPath("~/Files");
List<ListItem> files = new List<ListItem>();
foreach (string file in System.IO.Directory.GetFiles(path))
{
files.Add(new ListItem { Text = System.IO.Path.GetFileName(file), Value = file });
}
foreach (string dir in System.IO.Directory.GetDirectories(path))
{
foreach (string file in System.IO.Directory.GetFiles(dir))
{
files.Add(new ListItem { Text = System.IO.Path.GetFileName(file), Value = file });
}
}
lvFiles.DataSource = files;
lvFiles.DataBind();
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim path As String = Server.MapPath("~/Files")
Dim files As List(Of ListItem) = New List(Of ListItem)()
For Each file As String In System.IO.Directory.GetFiles(path)
files.Add(New ListItem With {.Text = System.IO.Path.GetFileName(file), .Value = file})
Next
For Each dir As String In System.IO.Directory.GetDirectories(path)
For Each file As String In System.IO.Directory.GetFiles(dir)
files.Add(New ListItem With {.Text = System.IO.Path.GetFileName(file), .Value = file})
Next
Next
lvFiles.DataSource = files
lvFiles.DataBind()
End If
End Sub
Screenshot