Get file directory using username and password
<p>I have a series of virtual machines deployed to an Azure virtual network that are connected to our on-premise server so that we can access the application via the UNC \10.101.1.5 which is mapped to a config variable "Input Folder"</p>

<p>Due to the change in architecture the following code is no longer being accessible via the network credentials of the signed in user and I want to pass a username and password into the directory info search is this possible?</p>

<p>'Get all the files in the input directory
Dim directoryInfo As New IO.DirectoryInfo(ConfigurationManager.AppSettings("InputFolder"))
Dim files As IO.FileInfo() = directoryInfo.GetFiles()</p>

<p>Is there any way I can pass the network credentials in to the DirectoryInfo method?</p>