Windows Embedded HTTP Server with Bonjour(Zeroconf) Support - c#

I need to find or create an HTTP server that will run on a Windows machine and announce its presence via Bonjour(Zeroconf). I've searched all over the web and can't seem to find anything that fits the bill or even any information about how I would go about adding the Bonjour functionality to a server that I create.
I found that apache has mod_zeroconf, but it only runs under Linux and found that Apple provides a Bonjour installer for Windows, but it doesn't appear to add the announce functionality. I feel like I may be searching in the wrong places.
For my current project I'm ok with using something off-the-shelf, building with C#/.Net, or even rolling a rails/rack based server and setting up the announcement as a separate process.

I suspect you'll need to integrate Mono.Zeroconf.

Related

How to create a public server in C#

I am a novice programmer. I was trying to learn about networking in C#. I want to know how to create a public server in C#. I tried to search on the internet but I didn't find much. As a public server, I meant to connect to one computer to another from remote or an online server where I can connect from anywhere which is written in C#. I want to know is how to make it and what I need to do that or especially I want the information how can I make one and what I need. I would like to use winform/wpf or console application for the server.(Sorry for my bad English)
There are plenty of resources out there already, you just need to do your research.
A couple notes:
winform/wpf is a technology for desktop programs, with windows and user controls and such. A server has no need for such things.
a server is a server, public or not. Making it public is as simple as making it available at an IP address / domain that is reachable from the internet. This has little to do with implementation.
there are so, so, so many different types of server applications. Some serve websites, others serve databases, and still others just provide raw data in the form of JSON or XML.
I'm assuming since you're just getting started, you're trying to build a web server to serve a website. Here's a tutorial I found by Googling 'c# web server' that seems to get you up and running: https://codehosting.net/blog/BlogEngine/post/Simple-C-Web-Server
Good luck, and remember that SO is a place for technical questions, not a 'how to do a whole thing start to finish' forum :)
I think the keywords you need are
ASP.NET + IIS, for a full fledged server app
HttpListener, for a stand alone server app
The prior is a framework for building a MVC Server application (it also has a subset called WebApi which as the name states is for APIs), and the latter is the class you will need to create a stand alone server application.
In the future, you might want to consider using ASP.NET Core to deploy your application onto linux.
Good luck.

Creating a web based device config utility

I want to develop web based configuration utility for WIN CE 6.0 device. This webpage is expected to configure/access/modify device's registry settings, reboot device etc. WIN CE Device has a webserver running on it. I am clueless about how to start.
Suggest some way to modify registry values using webpage.
Take a look at the source code for the default web admin module. Fair warning, it's ISAPI, it's near impossible to debug with anything but MessageBox calls and it has to be done in C++. But it is free.
The source is installed with Platform Builder and ends up on your dev machine at
%WINCEROOT%\PUBLIC\SERVERS\OAK\SAMPLES\HTTP\WEBADMIN
Another free option would be to create and install a COM object (written in C++,. most likely with ATL) on the target. Your web pages could then create an instance of that object and use it to interact with the device using the built-in "classic" ASP server. Installing the COM object on already-deployed devices or devices where you don't create the OS is going to be a large support challenge. Debugging these objects is not fun (though slightly easier than ISAPI if you build a separate test loader app). Also be aware that the built-in ASP server supports only a very scaled-back subset of ASP 3.0 (which is obsolete to begin with).
All of the web-based device admin we've ever done (and we've been doing it for a decade) has been through the Padarn Web Server, which uses C# following a subset of the IIS object model. It's a commercial product, so it's not free, and for full disclosure it's a product that we created (because I felt the built-in option is so bad) and sell.

Questions related to Installing Silverlight on Mac

We are planning to develop a Silverlight 'cross platform' application, that is expected to run on both Windows and Mac with elevated permissions. Mono alone is not an option, as the application requires Silverlight specific video features, supported only in SL 4.0
So, here are some considerations.
1 - The 'Application', should interface with a local database (outside Isolated storage)
2 - The application should be able to talk to native libraries for performing some DVD IO operations.
3 - It has to be installed via a custom installer, much like a desktop app
We are trying to identify the best way to to satisfy the requirements, if possible, with a common code base, probably using SQLLite for the database.
In Windows, things are straight forward. You can use sllauncher to install the XAP with elevated permissions, and you can access the SQLLite and other system level operations via probably a COM layer. Not a big deal.
But how to implement interfacing with SQLLite and system level libraries in Mac? Is there a documented/undocumented way to interface with Mac libraries from Silverlight (Mac)? I think no. One option might be to use Mono's XSP web server, and run an ASP.NET site from the local machine, and host the XAP locally, and then implement a handshake with the ASP.NET code running via Mono/XSP, and then do the interfacing from there.
Another option will be to host the Silverlight in the Mono's Winforms browser control (I still need to see if this is possible), and then do the talking between Mono Winforms browser and Silverlight via HTML DOM.
Both are not straight forward options in Mac.
I highly appreciate any inputs you can provide to achieve the objectives in a better way.
Part of the solution could be to define an interface on your database. In windows you could choose to talk directly to it, and for mac you write a soap server. Your silverlight app should be allowed to talk to that. You can implement the soap server in mono, then you have one language all way....
I don't believe the Winforms browser control works on Mac, but you could try MonoMac instead.

How to start up your .NET program from web browser?

Could you provide example of JavaScript function for starting up application installed on your computer from a web browser (eg google chrome 4). It particular if .Net APPs have any special simplifying this process apis of out there are some libs for such staff, please share link with us.
so how to create and store in run on start up programs a small local server which would handel some local urls like http://localhost/maAppServer/MyAppCalculator/Start for starting apps that have written in its config file their names and local urls on install?
So how to start up your C# .NET app\program from web browser?
I don't believe its possible in Chrome, starting an EXE on a users computer could be considered a security violation. Some ActiveX, and file:// links in internet explorer may work. Also, OneClick deployment may do something similar to what you are after (not exactly though I don't think, and I believe they require an add-in which may not be available for Crhome) http://www.15seconds.com/issue/041229.htm
I'm not sure what you're asking for. You can start an application on your computer just by linking to it in the HTML page. However, if you need to pass data to it, then it's a different matter altogether, although it's still simple.
An example is what www.nexon.com does with it's MMORPG, MapleStory. You log on to the website, and the web page starts the game after the authentication. Another example would be the magnet links on file-sharing sites.
You need to create a protocol handler, it can be in any language like C++/C# and register it on the client's computer. Like so - http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx
Then, just use the protocol you built to pass on whatever data necessary. You can add a link that can be clicked, a button, Response.Redirect() from the server, whatever you like.

Web-Update class in WinForms application

I have build an C# Winforms application which will need regular updates and patches in the future. To ease the update process for the users of my app I'd like to build an web-update class that looks for an update on my site.
What would be the most secure and reliable way to implement such a class, considering:
The site is build in PHP / Joomla
I haven't the foggiest idea how to program in PHP
All webserver directories are read-only by default (and only writeable by an FTP account I own)
The first and so far only idea that comes up to me is to create a file on my webserver that'll never be renamed, and in it I'll define the location of the latest version and number of it. The app will then be able to download the update from that path using the WebClient class.
However, if there's anyone with a better update-class idea that doesn't require an asp.net webserver nor webservices (already tried and failed on that one), I'll be grateful.
Edit:
I've tried the ClickOnce solution suggested by Gabriel McAdams, but on application startup I experience a "ClickOnce launch utility has stopped working" crash. So I'm again looking for a solution to update an application. For the moment, the answer of Kristian Damian is the most suitable.
I would look into ClickOnce Deployment.
Here is some of the text from that page:
ClickOnce deployment allows you to publish Windows-based applications to a Web server or network file share for simplified installation. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce.
Maybe this link can help you:
http://themech.net/2008/05/adding-check-for-update-option-in-csharp/
I developed a Windows application in C# that does updates automatically over the Internet. After much grief, mainly because at that time I had very little experinece with Web development, I purchased a product that made it easy to update the application. If it is OK with StackOverFlow and you are interested, I can give you the URL.

Categories

Resources