I have created a windows form application that is a face recogniser using EMGU CV. I also have a website which is locally hosted on my laptop, made using ASP.NET MVC4. I want a link on my website which ,upon clicking, opens the facial recognition software. Is it possible to do it? Do I have to create a setup of application and install it to do this or is there any other way?
The effort involved to do what you are asking for is almost certainly much higher than you are willing to take on. I'm only aware of two possible approaches. The first is to use the Microsoft Click-Once technology, which streams binaries through to the client. However, the binaries arrive at the client very untrusted, so you need to do quite a bit of work on the client to set up the appropriate permissions. The other approach is to associate your image recognition form with one of the safe MIME types, and then stream out a file of that MIME type. If your application is the default application for that type, it will be called to handle that file.
Related
I’m looking for a way to embed a single page style web application into an industrial pc that’s running TwinCAT 3 plc to control an automation system. The hmi on this system is already written in c# using the beckhoff ads dll. What I’m having trouble with is how to embed the server that’s reading and writing data to my plc instance and the web page front end into one application. I’m looking to use c# or python as those are the languages that I have experience in. I would like to be able to log into this webpage by the up address of the Pc and get a page on a phone or laptop that allows elements on the screen to be interacted with like buttons and a joystick style control for creating motion on the machine.
Which OS is the PLC running on? If WinCE, its a bit trickier. You'll need VS2008 to compile against the NET35CF for C#.
With a "full" version of windows, things become simpler - you can use whichever version of .NET will fit on the controller, or whichever version of Python supports the python ADS library.
After that, create your connections into the PLC as per the Beckhoff ADS examples when required by your web page.
Of course you will need to manage the web server accordingly. Some Beckhoff PLCs already use IIS for basic diagnostics, so you would have to set up an appropriate route to your page to avoid conflict.
I've written an application in C# that I would now like to host within an ASP.NET website (MVC 2).
The application can become quite resource intensive so I would like to set up the system in such a way that each user downloads the application and runs it locally, but still within the web page that I provide.
My first idea to solve this problem was to host the program within a silverlight application. However, the app I want to host was not compiled for Silverlight, and I would like to use MySQL in it, which also appears to not be possible directly (ie without a web service in between).
The bottom line is that don't have experience with these things directly yet, and I need to research the way to make any solution possible. So I would really appreciate some input to put me in the right direction, and not have to implement 3 wrong options before finding the right one. I would also really like to avoid JavaScript if at all possible.
Thanks in advance.
Update
I probably should have specified to begin with what the application is exactly.
The application as I want to host it on the website is a simple chat program. It needs an input box and text output. The old windows forms application won't have to run in ASP, but I want to use the class library behind it, which is a chatbot engine. That engine is the part that can be rather resource intensive.
So you wrote a "rich client" application and you want to serve it as a web/silverlight application. This is not possible without changing the architecture of your app, as you probably guess, expecially because you have to interface a database. If rewriting the application to support such architecture is not an option, the best in order to me is to use Remote Desktop, but you have to pay for licenses in order to support many connections.
If your application is not a web application then it will not run on the server. The only thing your server does is to provide a download location. For that, you wouldn't need a MVC site - static pages could fit. The programming model between normal applications running on the client and server applications running on IIS is completely different. So in short: you won't be able to host your client application in ASP.NET MVC. If this is a requirement you will end up rewriting the application.
If your application is ASP.NET WebForms and it becomes too resource hungry, then you probably won't solve it by just switching to MVC. You have different options then: more resources on the server side, analyzing what could be done to lower the resources required or moving away from a server based application. This is not a black/white decision, maybe a combination might fit.
I'm looking for a suitable client side architecture that will meet some or all of the following requirements.
I'm thinking primarily about Silverlight (but I would also consider MVC or WPF depending on your suggestions - I can possibly trade some of these requirements off, or find work arounds).
I'm looking for an assessment of Silverlight being able to fully, partially or not able to support, each of the following, with detail around each if possible:
Must be able to reliably upload large (~100MB) binary files via WCF and MTOM
Must be able to support file downloads, preferably in the background (i.e. through 'synching'), though this could simply be supported through a manual URL if necessary
Should have access to some form of local storage - this could be binary or XML for config purposes, but ideally some kind of database (not fussed which, as long as it is part of the install/app)
Should be able to dynamically configure itself depending on user profile. In other words, where a user logs in, the UI and services available are dynamically determined.
Should support some form of client notification (sound and or tray bubble). Ideally this would be supported via WCF duplex, but could be accomplished through polling.
Ideally, should run on multiple platforms (Win / OSX)
Should be easily deployable - if I need to run Silverlight in full-trust mode / OOB - how do users get new versions?
Should be minimisable to the system tray
Any detail or thoughts you can give me on the above would be much appreciated.
Edit - additional questions
Are there any limitations on local storage/access in Silverlight 5 OOB? Or does it behave like a standard WinForms app?
Is it possible to bundle SQL express with a Silverlight OOB .msi?
What is the best option for dynamically configuring a Silverlight app? I've seen MEF mentioned - is this the preferred approach or are there others?
Must be able to reliably upload large (~100MB) binary files via WCF
and MTOM
Should work.
Must be able to support file downloads, preferably in the background
(i.e. through 'synching'), though this could simply be supported
through a manual URL if necessary
Unless you are running OOB with elevated trust (or SL5 in browser elevated) and thus have limited access to the local file system, you would need to ensure sufficient space in Isolated Storage for the downloads.
Should have access to some form of local storage - this could be
binary or XML for config purposes, but ideally some kind of database
(not fussed which, as long as it is part of the install/app)
See above. Regarding local database support there is an SQLite port for Windows Phone 7 which also works in Silverlight (I've recently tested it).
Should support some form of client notification (sound and or tray
bubble). Ideally this would be supported via WCF duplex, but could be
accomplished through polling.
The notification can be done through Silverlight's Notification Window (supported from SL4 and up). The actual server side notification could be done through duplex channels or Kaazing WebSockets Gateway etc.
Should be easily deployable - if I need to run Silverlight in
full-trust mode / OOB - how do users get new versions?
You can install an OOB Client along with the runtime with an MSI installer and still have the Silverlight standard update mechanism work for you (required Authenticode signed XAP). I've done just that a couple weeks ago.
Should be minimisable to the system tray
AFAIK not possible in SL4. Not sure about SL5.
All the points I have not quoted should work.
Having done some Silverlight development I often feel a bit restricted by the possibilities it offers. In my opinion it is meant to be run within a browser, with a web-like interface. From what you describes it is more of a full app you want so I would recommend WPF and click-once deploy that handles updates automatically.
From your requirements I would suggest WPF, full application support, but when it comes to OS X support, then you have a problem, WPF won't work on OS X, only Silverlight will, so I am afraid you have a few requirements that have conflicts with one another.
I'm a beginner in programming. I've just made a program called "Guessing Game". And it seems to work fine. Can I integrate it into a website? The CMS that I'm using is Mambo.
===
additional info's
Thanks for all your suggestions.
I still don't have any background about Silverlight, WPF and Java Script which I think sounds good. I'm using Windows and I programmed my "Guessing Game" from Microsoft Visual Studio 2008 and it's using Window application forms.
Yes I guess, for the moment I let it be and start to learn Silverlight or Java Script so that I can integrate it on my website:-)
Thanks for all your input guys:-)
Cheers
A standalone executable cannot be directly integrated into a website. You have a few choices though:
Allow your users to download the executable and run it locally for themselves
Rewrite your program in JavaScript to have it run directly inside of an HTML page, though this could obviously involve a fair amount of reworking
Use Microsoft's Silverlight technology, which allows you to code in C# and produce a web-based frontend similar to Adobe Flash. Your program logic should remain the same and you should only have to change the UI code. In fact if you're already using WPF for the front end, the transition will be even easier.
There are several questions that you still need to answer.
What is your server running? If its not Windows, your exe will not run at all unless it is compatible with Mono or a similar framework for your server's operating system.
How does your "Guessing game" interact with the user? If it is through a WinForms GUI, it will you will not be able to use that GUI on the web. If your game is a WPF application your easiest route may be to port it to Silverlight and serve it up on a web page.
It is typically not trivial to make a regular windows application run in a web environment since on on the web you are really running in the browser, not on Windows.
Yes - in general, when you're talking about software, anything is possible. The question is, how difficult will it be?
To understand that, you have to give us more details about "Guessing Game" including how it is designed, what it's interfaces are, how readily extensible it is, and how prepared you are to change or extend it.
For example, if it is a Windows Forms GUI app, then it will be diifficult to integrate into a web app. If it is a console app, then it will be a little easier. If you can modify it to run as a Windows Service, then a little easier. If you can modify it to accept input from the network (as opposed to getting input solely from the keyboard + mouse), still easier.
You may be able to use reflection to load your assembly into the web application, but most likely, the answer is no.
Your best solution is probably to re-write the game in javascript.
The short answer to your question is now. I'm presuming that since you're running Mambo you're web environment is a LAMP stack. However, you're "Guessing Game" is most likely a Windows application from the sound of it. For a beginner in programming, there is no integration path you're going to be able to take that will allow you to have your game running on your website.
However, here are avenues you can take, which will require a significant amount of time to learn. I'm not saying you shouldn't take time to learn, by all means you should! I'm simply trying to illustrate the fact that this is not something that is going to be doable in a couple of hours.
Silverlight - allows you to run C# code with a WPF like interface on your client's browser and can integrate with your web site through javascript.
Let your client download it from your website and run it off of their PC. This would actually be fairly trivial and would be your quickest option, but it sounds like it's not the kind of integration you were looking for.
Can WPF be hosted in a web browser? If so how? (I think it can as I have seen some examples of it.)
While hosted in the web browser what printing support does it have?
What are the drawbacks to using WPF in a browser?
My company is looking for a rich web app platform. They will not choose Silverlight because it ignores any printing needs (at least as far as I understand). Right now a solution from Adobe is in the lead because it supports printing.
Most (if not all) of the apps written for browsers will be used internally by my company (ie we control the computers and browsers). (We want to use browsers for easy of deployment.)
Have you checked out XBAP (Xaml Browser APplications)?
The major drawbacks I am aware of concern security. When some coworkers of mine were developing an XBAP product, they often ran into problems with security, as the XBAP model is pretty strict.
I can't answer about printing, but I'd tend to think that might be a problem with the security considerations.
Hope I was able to help.
If the apps are solely internal and you control the target platform; and the reason for choosing to host your apps in the browser is 'ease of deployment', I would seriously consider writing Full Trust applications in WPF, and deploying them with ClickOnce... Your users would simply have a shortcut on their desktops that would check a server to see if their version of the app is current, and download the newest version if not.
You get all the benefits of the full WPF platform (greater feature-set than Silverlight), and do not need to conform to the Partial-Trust restrictions of XBAP (although you will need to configure the ClickOnce server to allow for Trusted Application Deployment)
No. That's what Silverlight is for right now and yes there are printing limitations. However, printing anything using a web app is not straight forward.
I would suggest Silverlight/Flex solution for web based app and for printing need the best way to do is use iTextSharp library and generate PDF for your reports or printing need, which can be fetched from a URL. PDF is a very standard and adobe reader will always print it right, printing will not be a problem, we went through lot of options and it requires reinventing wheel where else generating PDF through iTextSharp is very easy as creating normal html in javascript way.