Wednesday, April 28, 2010

XBAP - SiteOfOrigin Files


I used this little snippet after a couple of hours hunting MSDN forums

StreamResourceInfo f = Application.GetRemoteStream(new Uri("pack://siteoforigin:,,,/"+fileSolutionPath));

//f.Stream //to your IO with this

Note: siteoforigin files are downloaded from the host on demand, so should be downloaded as needed.

Cool little beasty

I actually used this to copy some configuration files, DICOM Server Association files, to my Full Trusted XMAP home. I had made the Full Trust XMAP home (Environment.CurrentDirectory) a Temp folder i.e. System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MyAppName") and needed to get the association list for a Storage SCP.


f.Stream.CopyTo((File.OpenWrite(Path.Combine(Environment.CurrentDirectory, fileSolutionPath))));

No comments:

Post a Comment