I have a directory of HTML files and images added as resources in Visual Studio; these files link to each other.
I can load any one of them as a stream or string and load them up into the WebBrowser, but if I do that, hyperlinks between the files break, because the document no longer knows that it's in a directory with other files.
I don't want to load the files as file:// URLs on disk, because they also contain JavaScript; by default IE blocks them from running active content.
How do I load these files in a WPF WebBrowser?
Related
I'm building a web application that is supposed to take files from wherever in the LAN and display the content of those files. The application also uses a javascript library for generating embed objects to preview the files, if they are pdf.
The problem is that i can not successfully seem to link to those files, be them images, documents or videos.
The url is either formatted by Google Chrome by prefixing it with the address to the local web page, or interprets it as a local file and denies access to load it, or throws a connection time out if i manually prefix the file urls with http://lan-server....
As I said i tried formatting the urls to these files (the ones on the lan machines) in different ways, but none of them work.
Here is an example of an to a file in LAN
http://is-something/Subfolder/test/image.png
This one gives a timeout error
Here is another one
\\is-something/Subfolder/test/image.png
This one is prefixed with the address of the current webpage (http://localhost...)
I also tried using file:// way to access the files but it seems this only works for the local machine
So what i would want is a way to acces the files that i spoke about.
I need to use them in html elements for the src attribute, as well as in the css rules (for background url).
I created a simple app that is a HTML page that generates price quotes. The client wanted it on certain machines and no where on their intranet. So I have a folder with the html page and a javascript file and custom icon. I want to send them a zip file of this folder with a shortcut file already created with the custom icon (that is inside the folder I'm sending).
The link isn't launching the index file in the folder
shortcut retains icon and file locations on MY machine.
why can't I edit the shortcut target from "C:\Users\xxxxx\Desktop\Current Projects\app\desktop\FOLDER\index.html" to just "FOLDER\index.html" ?????
SAME THING AS #3 but for the shortcuts START IN
Why can't I just use %USERPROFILE%\Desktop\FOLDER\index.html ???
I am developing a Silverlight 4 application which displays items in a carousel control. The items are parsed form an XML file and then loaded as an image which can be double clicked to open a website, file, image etc.
I am already running in higher privileges mode (out of browser) to access the Xml file which sits in a subfolder of the application.
I can load the images fine when they are added to the project as they are included as resources. However, I need to be able to load images which aren't individually added to the project. Instead, I would like to add all images in a particular folder as resources.
Is this possible?
Thanks in advance
From Advanced Silverlight Out of Browser- Introduction
When running in a trusted environment,
you can access only files in user
folders, specifically the MyDocuments,
MyMusic, MyPictures, and MyVideos
folders
So, if you want to access folders other than this, you would probably need to run some sort of service, which has the proper rights. What kind of service depends on where this app is running. Could be a WCF service, or a simple WebService, if you can run a webserver on the machine. Otherwise, you'd need a windows service of some sort.
I created a custom user control which contains an <Image /> control. My user control is bound to a CLR object which contains the proper filename to use for the <Image> Source property.
The user control is located under Controls folder in my Silverlight app. When the app runs, the image is only displayed if the image is in the same folder as the user control (i.e. the image must in the Controls folder).
How can I make the image source be relative to the location the Silverlight app is running?
The app is hosted in an ASP.NET MVC application.
A relative path that starts with "/" is considered be routed at the top level of the XAP file and (if the resource is not found in the Xap) in the server folder from which the XAP was downloaded.
In other words place a "/" at the beginning or your Urls and you will probably get the behaviour you describe.
When you create a Silverlight Business Application you get a Silverlight application and a Web application. In the Web/Resources folder of the Silverlight app there are links to the files in the Resources folder of the Web app. These links are exactly like the files they link to in that they are heirarchical with the Resource.Designer.cs file shown as a code-behind file for the Resource.resx file
When I try to link to a Resource file in this way I only get the .resx file unless I link to the .Designer.cs file separately. However in this case the Designer.cs file is then shown as a standard code file and not related to the .resx file.
Does anyone know how to do this linking correctly?
After you add a link to new resource file without *.Designer.cs, set its property "Custom Tool" ("PublicResXFileCodeGenerator").