Search and open pdf documents that are inside a folder using silverlight, C#

  • Thread starter Thread starter Eddy RH
  • Start date Start date
E

Eddy RH

Guest
I need to find a way to search and display pdf documents of a specific route, I have the following code where I show the route and its folder (transfer.IdTransfer)

System.Windows.Browser.HtmlElement myFrame = System.Windows.Browser.HtmlPage.Document.GetElementById("_sl_historyFrame");
if (myFrame != null)
{
myFrame.SetStyleAttribute("width", "1024");
myFrame.SetStyleAttribute("height", "768");
Uri uri = new Uri(@"\\192.168.1.216\UploadFileMobilePDF\" + transfer.IdTransfer);
string path = uri.AbsoluteUri.ToString();
myFrame.SetAttribute("src", path);
myFrame.SetStyleAttribute("left", "0");
myFrame.SetStyleAttribute("top", "50");
myFrame.SetStyleAttribute("visibility", "visible");
}

I have tried to implement a foreach cycle to search for pdf documents, but apparently silverlight does not allow it to do so as follows:


DirectoryInfo folderPath = new DirectoryInfo(@"\\192.168.1.216\UploadFileMobilePDF\" + transfer.IdTransfer);
if (!folderPath.Exists)
{
return;
}
foreach (var file in folderPath.EnumerateFiles("*.pdf", SearchOption.AllDirectories))
{
System.Diagnostics.Process.Start(file.FullName);
//Uri uri = new Uri(folderPath + file.FullName);
}
I want to know the correct way to search and display pdf documents using silverlight, please




Edgar Rojas H.

Continue reading...
 
Back
Top