Home > database >  How to create an .exe from an HTML5 in webBrowser?
How to create an .exe from an HTML5 in webBrowser?

Time:12-06

I have created an Adobe Animate application that generates an .html file, a .JS file and a .png file. I would like to convert this application to .exe. To do this, I use the "Windows from" application in Visual Studio in which I have inserted "WebBrowser". I indicate then the file and the directory to open the index.html file:

this.webBrowser1.Url = new System.Uri("J:\Mes Documents\bol9\index.html", System.UriKind.Absolute);

When I click on "Start" the program tells me "an error has occurred in the script of this page". The error indicates that the problem comes from the "src" lines of the html.

Being a novice in the management of Visual Studio, I would like to ask for your help to solve my problem.

Translated with www.DeepL.com/Translator (free version)

CodePudding user response:

I don't know if this is the problem as stated in my comment, but you could check about escaping the space in your path:

J:\Mes Documents\bol9\index.html

you will need to tr a few solutions to your problem, as i can't test myself.

Why spaces can be addressed as a problem? Usually there is a whole history of problems linked to them in programming, as stated in https://www.w3schools.com/tags/ref_urlencode.ASP

Notice that here they talk about URLs, i dont know if the same rules apply to your local path, but you can try.

URLs can only be sent over the Internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format. ... URLs cannot contain spaces. URL encoding normally replaces a space with a plus ( ) sign or with .

Lastly, if all this doesn't work, you can try to add a backslash to your space:

*J:\Mes/ Documents\bol9\index.html*

Please let me know if this works, hope i was clear and i can lead you to the right solution.

  • Related