0

I want to write a client software, that can be installed on user's desktop machine. I want to write a shell in C# and involve GeckoFX as embedded WebBrowser to render view by using html + css.

The problem is, if i do like i said, i need a webcontainer to get those web pages run in.

My solution right now, is write a embedded tomcat. Package this embedded tomcat and war file and the C# stuff in the installation file, every time when end user launch the program, the C# shell should create a new progress to start the embedded tomcat to provide the webservice. And kill this progress when C# shell is shutting down.

I don't think it is a good way, but i am really new to this area, does anyone can help to suggest a better way? Thanks very much.

Howard
  • 4,474
  • 6
  • 29
  • 42
  • Well.. embed the CSS in HTML. With the MS WebBrowser you would do something like: ´WebBrowser webBrowser = new WebBrowser(); webBrowser.DocumentText = "...";´ or if you like it complicated : ´webBrowser.Navigate("about:blank"); webBrowser.Document.Write("...");´ Maybe you can give Gecko also a String (or a stream)? – Offler Jun 28 '13 at 08:38
  • The thing is, i know how to use GeckoFX to navigate to the url and display it. But it requires me to provide a webserver to expose webservice, right? So i have a embedded tomcat to run my war file to provide the functionality locally. But it seems not that professional, i prefer a better way than webcontainer. I am not sure that if i made myself clear. Anyway, thanks for reply. – Howard Jun 28 '13 at 08:57
  • I don'T know what you want to do with webservice... but it is simply to host a webservice ´Uri baseAddress = new Uri("net.tcp://localhost:48080/TestService"); using (ServiceHost host = new ServiceHost(typeof(MyContract), baseAddress)) { host.AddServiceEndpoint(typeof(IYourContract), new NetTcpBinding(), ""); host.Open(); Console.ReadLine(); // keep the service open host.Close();}´ All you need is adress, binding, contract, so most work will be the interface of teh contract of the webservice. – Offler Jul 01 '13 at 14:25

0 Answers0