Share program variable values with Javascript running on browser - c#

I'm developing a C# windows form application which scan passports in a client PC
in the same client PC user is going to open a webpage with which has some textboxes.
Is there any way to share some values of windows form application with the browser page?
(IS there anyway to invoke some functions in Windows App through RPC from the browser JavaScript, or any mechanism of share or send these values)
.

You can use the web server as a mutually accessible resource. The c# application can send data to the server, and the web browser can poll/listen for updates from the web server using AJAX. If the Windows application is also connected to the server, it could receive updates from the web page.
Alternatively, if you want to do a one-time sharing of data between the Windows app and the website, you could:
collect data in Windows app
send it to server
receive a unique ID
launch a web browser with the unique ID in the query string
website finds the data which was just sent by the Windows app.
Certainly there are other ways to do it as well. My goal would be to avoid having to have any knowledge of the web browser in use, e.g. requiring a plugin to be downloaded to facilitate the communication between the browser and the Windows application.

You'll want to implement a small http server in your C# app that can respond to http requests. Your web page can then make a GET request to the appropriate URL to fetch the data to populate the fields.

Related

Accessing browser cookies from .Net WinForms

I have an internal angular application which connects to a Web API for all business logic and data. Company users can log in, and there is a cookie which stores an identifier. The API is also aware of the identifier, and can associate it with the user/computer. Now, I have some usb proxcard readers which have an SDK which can be used in .Net desktop applications for reading proxcards. I want to have a .Net WinForms app running which reads the proxcard, and then can send the proxcard value to the API along with the identifier stored in the browser cookie (because the API needs to know the user/computer). Is there a way I can read the browser cookies from my WinForms app in any of the top web browsers? Or an alternative way I can get the identifier between the WinForms app and the browser app? Thanks

Trying to use a xamarin app to create a user login for a website

I have a cross platform app currently designed using xamarin forms but now need to use this to create a user profile for the user, using the information provided, for a website.
Are there any add ons or plugins for something like square space or wordpress which would allow me to upload a user program via a RESTful api or something along those lines?
Basically what are my options to transfer user data from a cross platform app to a web app so that my user can then log onto the web app and see all their information?
All you need is a database that can be accessed by both your web app and your mobile app. There are numerous services that would allow you to do this.
But if your web site is going to be a WordPress site (I have never looked into squarespace) then it already uses a MySql back end for data storage. I would imagine squarespace uses a database of some sort as well. You could then create RESTFul urls on that same server to send and request data and use whatever database system that your website is using. If you don't want to implement your own service code for sending and receiveing data that can be used by both your web app and your mobile app, then you could use some service like Azure, AWS, Apigee, etc. just for the database.

Consuming a WCF RestFul API from android not from wifi connection

I have just completed my first WCF REST api that makes use of JSon for posting data back to a client app. As part of the dev process I made a quick sample c# forms app for testing. I serialize the incoming Json response and bind to gridview. An example would be of retrieving Balances for the associated ID's of accounts. I have yet to host this, but the idea is to host it on a client server, and for them to be able to develop 3rd party apps.
I really really want to develop a simple sample Windows Phone or Android app, for showcasing as well as learning how to access this hosted service. I have found plenty of articles on accessing via being connected to wifi. But, say I want to develop an app and distribute this on an app store. For users connecting via mobile connection, say 4G, how would this be achieved? If I host via IIS on a server, would I be able to use the URL in a client Android/Windows phone etc. app, authenticate via an API key and retrieve the data?
Please can someone advise on how to go about or where to start please?
Thanks in advance.
You would buy windows web hosting and deploy the WCF REST app there, it would be available on a global domain like http://myapp.com/wcf-app.
Android & iPhone apps would connect to the global address and view the information from the JSON requests, as could any one with a browser.

What are my options for sending data from Windows app back to developer without using a webserver

I am writing a simple WPF quiz application for a family member and he would like users of this application to have the option to send him their scores once they have completed the quiz. I was hoping to do this without the need to create some kind of webservice for the app to talk back to.
My initial idea was to email the results back, but that runs into problems. What if there is no SMTP client on the user's machine? I don't want to embed a password for a public smtp server into the application. I could do a Process.Start("mailto:..."), but that requires their machine to have a handler for mailto: and for them to click submit on the generated email.
Another idea I had was that the app could add a line into a Google docs spreadsheet, but that would mean a google docs password would need to be embedded in the app.
So my question is, without me writing a separate application running on a webserver for my WPF app to talk to, is there a good way of my app sending data back to me that doesn't require a password? I'm guessing there must be some kind of public webservice I could use for this?
If you're happy with a third party service that can do this for you, consider Parse, or any other 'backend as a service' provider.
You should then be able to implement something else that reads the saved data from the service when required, without having to expose itself as an API.
Create a google doc forms and when you need the user to submit their score, launch a web browser with the doc url. You can auto-populate the fields by query parameters( ... &entry_0=Barney&entry_1=Google& ... )

self hosting web pages?

we are trying to build a some program that will sit on the clients servers, then a user will enter a url in his browser that will go to our program on his servers. the program will call some data at our servers and will return an image in his browser is it possible to create under wcf self hosing ?
you could use a HTTP call to your site at the clients site to get the image or a more sophisticated technology like a web service. There should be no problem if both web servers are connected to the internet.

Categories

Resources