Silverlight Open File - silverlight

If i've got a filepath that the current browsers computer can access. Is there anyway that a silverlight application can open that file?
I dont want to run out of browser if possible as well.
Thanks in advance

In Silverlight 4 OpenFileDialog is the only option to access any place on the file system. Elevated trust, out of browser applications can access the current user folder only. However, in Silverlight 5 this type of application will be able to access anywhere on the file system.

From new features of Silverlight 5 at:
http://www.microsoft.com/silverlight/future/
Silverlight 5 extends features of the
‘Trusted Application’ model to the
browser for the first time. These
features, when enabled via a group
policy registry key and an application
certificate, mean users won’t need to
leave the browser to perform complex
tasks:
Host HTML content as a Web browser
control within the Silverlight
application. HTML pages, such as help
content or e-mail, can be integrated
within the application. Read and write
files to the user’s My Documents
folder, making it easier to find media
files or create local copies of
reports. Launch Microsoft Office and
other desktop programs. Users can open
Microsoft Outlook and create an e-mail
message, or send a report to Word
utilizing the power of Office. Access
devices and other system capabilities
by calling into application COM
components. Users can access a USB
security card reader or a bar-code
scanner. Enjoy full keyboard support
in full screen, which enables richer
kiosk and media viewing applications.
Call existing unmanaged code directly
from within Silverlight with PInvoke.
Note that this feature is available only on the Windows platform.

Related

Is Metro a good fit for apps that access the File System?

I understand that Metro limits the access an app has to the user's computer. Can anybody verify this, as I am considering creating an email client that will work with at least yahoo/at&t.net and gmail. Will I be able to access a user's email (assuming they provide their username and password, of course) with a Metro style app, or will I need to stick with creating an "old-fashioned" Desktop app for this scenario?
Metro applications can access the users Document Library, Picture Library, Video Library and Music Library without user intervention if the developer adds those capabilities to the Package.appxmanifest (double-click on it in Visual Studio and go to the Capabilities tab).
Even without these capabilities the app can read and write in its own local folders. And even with out these capabilities the app can prompt the user to open a file anywhere on disk using the FileOpenPicker. So yes, absolutely Metro can be used for an e-mail client.
For a sample of using FileOpenPicker (i.e. to add an attachment to your e-mail message) see:
http://code.msdn.microsoft.com/windowsapps/File-picker-sample-9f294cba
Metro can easily be used to create email clients. For something like this, you would be syncing data between the mail-server and the client.
Metro apps have limited access to the filesystem. But they can access Application Data Storage and isolatedStorage which can be used to store data pertaining to the application offline. This helper library helps store structured data in isolated storage, and might suit your needs.
For your scenario, a metro application would be a very good fit. However, the reach of metro applications will be decided by how well Windows 8 does after launch.

IIS and WPF video streaming

I need someone to point to right direction in both silverlight in WPF video streaming.
I have two projects, one is a Silverlight web page and the other is a WPF project. The goal is, on the WPF application the user is able to upload a video to the server, and the Silverlight web page streams it using a any web protocol (most likely http).
I'm using Expression Encoder SDK to build the code that re-encodes the video files (since the original video files will be very big, over 1gb each), and so far I think I've got it right, but now I need to stream it on the web, and I'm not being able to do so.
The silverlight web page is hosted on a Windows Server 2008 R2 with IIS 7.0.
I've been reading about IIS streaming, but everything I find points that every time the user wants to add a video, it must go to IIS interface and add it manually, and that cannot be the only way, since the user knows nothing about IIS.
If possible I would like some code examples on how to achieve streaming through IIS, and some pointer on what I could do, or am doing wrong...
Thanks
I dont see why user have to manually do it everytime in IIS. From your WPF app, make it store your video in a specific location inside your IIS. Also do a one time configuration in your IIS to deliver the video extension you are uploading, if its mp4 or wmv, give it the MIME type, "application/octet-stream", so when a user requests it, it will be delivered by IIS.
No, configure your silverlight app to read the file from your IIS directory (you must be knowing the filename it got saved in IIS in the first place.)
If you need to have a "streaming" experience, IIS won't be enough, you will have to use a streaming server like windows media server or flash media server.
Hope this helps.

Regarding Silverlight

I am developing a sample using silverlight and prism. I am trying to create a text file in the client side file system from my silverlight application. It is throwing the following error
File permission denied.
I browsed through internet and came to know that the option "Out of the browser settings needs to be enabled."
But i want to do the operation from my browser (with in browser).
Anybody help in this.
You need to use the SaveFileDialog class to ask the user to specify a location and file name for the file to be saved. This requirement is enforced to the protect users from potentially malicious uses of Silverlight.

Start WPF application from link in browser?

We have a requirement to start a WPF application with specific parameters from a link in a browser.
We are wondering if this is possible?
As an alternative could we embed the web application in a WPF browser control, and read the values out of the html web page?
Several possibilities :
if you control the browser (i.e. if you are in an intranet scenario, and have the opportunity to deploy applications), you can :
create an activex or plugin that runs the application
register a new uri scheme to interpret the url of kind "yourapplication://yourarguments"
(complex): deploy a listening app ran under the user session, and from the webapplication, ask this listening app to run the target application
reduce the security of the browser (not recommended)
if you don't control the browser:
create a clickonce application... this involves a setup, but which does not require admin privilege
Moving to Silverlight also might be an option, depending on your needs. SilverLigth V5 (still in beta) notably adds the ability for an admin to control the rights of the application via a GPO
Note: My feelings is the later option (Silverlight) is far more preferable because it's a lot more cleaner and less security hole factor. However, it can only be done if your requirements fits into the SL features
It is not possible to call client app from a browser, previously it was possible from activex controls but for that you need to have a signed library, in wpf you can make browser based application but you cant embed your web app in it.
So partially you are correct if you used wpf app you will be able to launch application on client side but with browser it seems difficult until unless you make activex control
but still i am not 100% sure that with activex control you will be able to launch the app or not

How do I programmatically access files in Windows Phone 7's Office Hub / Extend the Office Hub

I have developed a PDF Converter / Viewer for Windows Phone 7, but it is rather useless unless it can get the source files (Word, Excel, PowerPoint, etc) from somewhere.
An obvious place to get these files from is the Office hub on the phone, but there doesn't appear to be a documented way to access these files programmatically. I can only access my own application's files using IsolatedStorage.
Alternatively I would like to extend the functionality of the Office Hub with an extra button to convert a file, but I am not sure this is possible either.
Naturally I can retrieve files from a SharePoint Server, but I prefer not to do this unless I absolutely have to. Alternatively is there a way to map my application to a file extension so email attachments can be loaded into it?
Any brilliant ideas? How does the official PDF Viewer from Acrobat deal with this?
I'm afraid it's not possible using the SDK to accomplish any of these ideas for files stored on the phone.
The closest to load a pdf / office document from an app into the corresponding Adobe or Office application is to publish the documents on a server and link to them through a web page shown from your app. This probably doesn't suit your requirements though.
The official one does this utilising capabilities not available through the 3rd party SDK that we use.

Resources