I'm architecting one solution that needs to access one specific hardware (I already have the dll to access this hardware developed in C#).
My question is, can I develop one web application, and develop some plugin to web browser to access this dll in the client machine?
The idea is:
- Develop web system (client side and server side).
- Create plugin to Firefox or chrome, that will call the dll into client machine.
- Communicate my web system with dll into client machine through the plugin?
Someone can tell me if is that possible? If so, there's any starter point?
Appreciate for any help.
Give this a look, it uses Silverlight 4 to get system info from registry.
You could give Custom ActiveX a try as well (installing IETab in mozilla and chrome helps to run activex controls).
You will need to create an ActiveX control to achieve this. Read more about Active X here http://en.wikipedia.org/wiki/ActiveX
Principally, web browsers can execute / control active x controls which in turn can communicate to hardware on the client machine.
Active X controls work seamlessly on Internet Explorer. There are workaround for other browsers. This link should help http://www.tothepc.com/archives/enable-activex-controls-chrome-firefox-ie/
I am developing a solution to do silent printing from browser. I have found a lot of possible solutions like using a web based solution (as Google Cloud Print), browser extensions/plugins, and finally using custom protocols in browser and linking them to an application developed in any desktop programming language, which can access to resources from your computer.
Check an example here: https://stackoverflow.com/a/37601807/5373542
And the source here: https://msdn.microsoft.com/en-us/windows/desktop/aa767914
Related
Hi.
I have several questions. I developed an application using Visual Studio 2010. The application is developed using Windows Form and the program was wrote using C#.
This application needs to be run on a server. There are several clients connected to the server that will access and use that application through the browser. I know this can be done using Smart Client technique. But I don't really understand how to do it. My questions are:
Is there any syntax/class/methods/function that I need to include in my application? How to use it?
What settings/configuration do I need to set up so that the client computer can access the application in the server through their browser?
I know this can be done using ClickOnce but I don't know how. Can anybody tell me or show me the steps that I need to do to implement this?
Is there any syntax/class/methods/function that I need to include in my application? How to use it?
There are a few - but this is a large area. I would point you at couple:
WCF
ASP.NET Web API.
I would advise to use the later as it appears to be where the modern development is heading (at least to me).
Put simply, you will write your own web server, host it either in your WinForms application or migrate your WinForms to be a web application and host it on IIS, for example. Your web server will expose some API, which will likely to be based on HTTP protocol. A client application will hit web URLs. This will be a request-response paradigm.
Because this is a large area, I cannot name you exact classes, but have a look at ASP.NET site for samples.
What settings/configuration do I need to set up so that the client computer can access the application in the server through their browser?
It depends on the technology. Usually it's pretty simple - get it from tutorials and samples. In most cases this will be *.config file XML code and some minor bootstrapping in .cs files.
I know this can be done using ClickOnce but I don't know how. Can anybody tell me or show me the steps that I need to do to implement this?
ClickOnce is a deployment tool. You probably don't need that at this point.
I am given a project where we want to develop a POS based web application using asp.net.
I have already looked at POS for net and its a wel-known fact that due framework changes, POS.net needs some config file setting changes. My target framework is 4.5, and so far I don't know how many more libraries are depreciated.
I tried to create some sample applications for Proof-of-concept, I tired ActiveX components, SL4/5 applications to read client machine's COM ports. Since its a development env, I even tried accessing webserver's COM ports.
These applications have their own drawbacks. I also want to mention that since the development is under controlled environment, security settings( for ActiveX) isn't a issue.
1) Using ActiveX restricts the client machines to Windows OS. There is an option to created browser plugins using NAPI, but I couldn't get further with it as it has its own learning curve and the programming is in pyton.
2) Silverlight OOB( out of browser) application seemed promising, but the sample from
codeplex didn't work in all scenarios
Am I missing out on something?
Please note I have already studied WSPOS implementation.
So far the applications which we have seen that can access client machine's COM ports download a JAR file. The team is finally at a stage where they are concluding that this can be done using JAVA and not C#/.net.
Please let me know what basic point I am missing.
How much control do you have over the client machine? You could write a Windows Service that your web server would interface with. You would just have to know what terminal your user is logged in from.
I am using Asp.Net/C# in my application,I have a requirement where I need to access USB devices of client computer and run one of them.It is ok if the user has right to allow it or not.I need to know whether it is possible at all from browser.If yes what can be used here flash or silverlight.
Any suggestions are much appreciated.
Thanks
In other words, "can I use web-client technology running in browser sandbox for system programming". No, you can't. Neither Flash nor Silverlight can detect or run anything from USB devices. You need desktop technology like Adobe AIR or Microsoft WPF to do that.
Update:
If you really need to do something from browser that browser can't do, there is a way. Install helper application on user machine and control it from browser app via local network. I did it once, so it's possible. If you go this way, use what you like most - both Flash and Silverlight can do this.
I am working on a web application which will allow users to take exam online. When the user clicks on take test I need to block the calculator app. Is there a way to do that?
I am using asp.net,c#,visual studio 2008
Absolutely not. Your code is executing on your server, and the calculator is running on their PC. You can send JavaScript, Flash, Silverlight, etc. that is executed, but they run in a sandbox - can't affect anything outside the browser runtime. You wouldn't like it very much if websites could manipulate your PC would you?
This is not possible unless you force the user to install custom software on their computer. And if we go into that, this has nothing to do with the web anymore.
And to be honest, if you don't have any control over the environment the user is in... what's preventing them from opening whatever software you're trying to block on a laptop sitting next to the computer running the exam?
if you are in a Web application, you cant control your client machine. Only you can control your browser by using javascript or silverlight etc.
You have to install some extra windows application to protect that
I've been writing desktop apps in C# for some time now but I'm increasingly getting frustrated with the fact that not everyone has .NET 2 or Higher installed. I don't have the option of upgrading their systems to meet my needs. My apps are mostly utilities that run alongside the main program the company I work for has. They access the file system and the registry. Being relatively new to programming in general, I was wondering if moving these tools to the web would solve some of my problems. But I have no idea if web apps can have access to these parts of Windows. I was thinking of writing these web apps in either Rails or ASP.NET. So my question is this. Can a web app access and modify the registry and file system of Windows?
Thanks.
Nope, "web apps" like asp.net or rails apps run on the server alone and just serve html to the client. So all the client-side code can do is what jscript running in the browser sandbox can do, ie no file access or registry access.
You can however install an activex on the client computer that gets full access, but the user has to agree to install it as it's a security risk.
Writing the apps as Web apps instead (and Rails is cool to use) is a good option - your users don't need to install anything, upgrades are easy to do, and dependancies are no longer a problem.
However, you now need to start re-architecting your apps so they do not need to write anything to the client, except a cookie (that's stored in the browser). If you can do this, then migrating to a webapp will be great.
If you cannot, my advice is to learn the same language that your company's app is written in. Once you do that, the company app will have taken care of the dependencies already and you will just need to offer your utilities alongside the app, perhaps even in the installer, or just to copy the files into a subdirectory. If you're thinking of learning Ruby, then learning the corporate language will be just as difficult (only you'll be able to reuse a lot of code used in the main app)
No, a traditional asp.net application cannot access the file system or registry on the windows box. Simply put because it doesn't actually run on the client machine. Instead it runs on the server where it does not have access to the local machine.
It is possible to have portions of the application which run on the client machine. Browser based applications for instance. However these would require that the 2.0 framework be installed on the customers machine which puts you right back at square #1.
No, this isn't possible. Web applications cannot modify the registry and/or file system on a user's machine because of the security implications. You would need to develop a Windows app to do these kind of changes. You could always make this tool available for download on your website though.
No, you can't do that with a web application. Besides others have already said, a web application run in a browser, not inside an operating system, so all you can do is what browsers allows you to do and not all you want, and browsers doesn't allows you to take control of the host machine.
I'm guessing the desktop app used in your company uses the registry to store workstation / user specific (state)data.
Moving to a web based app does not mean storing state data is no longer possible, just account for it by including a table in your database that can be used to save that same (state)data in. The registry is no longer needed.
Another pro is that by moving to a fully webbased application, you never have to worry about your endusers, because the code is running on the server, all the enduser gets is the output in html :-D.
The only thing to keep in mind is cross browser compatibility, don't create an app that works in IE only for instance, it has to look and work the same in all major browsers.
There are a few products out there, such as Xenocode and VMWare's ThinApp, that allow you to virtualize your app's dependencies to the point where your .NET app can run on a machine without the .NET Framework installed. Just another option from left field.