Accessing browser cookies from .Net WinForms - c#

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

Related

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.

Share program variable values with Javascript running on browser

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.

Struggling to understand the structure of the Facebook API

Ultimately I want to create a desktop app that allows users to update their own status, view status' of their friends, update pics etc. - basically a lot of the functionality the facebook website provides. Through looking through some tutorials and sample projects it seems that an app must be created for the facebook account. Now is this the facebook account of the developer (i.e. mine) - which will provide an API key that will allow any other user to log in?? Does every desktop project need to authenticate the user through a facebook dialog window to take the users' credentials?? Where does OAuth fit into this?? If anyone can shed any light as to the structure of the facebook api and the ways in which I can grant this functionality from say a WPF C# app for example I would really appreciate it.
EDIT: Before complaints of a potentially huge question or too 'vague', my question is specific to the integration/use of the facebook API in desktop applications - not how to then retrieve status feeds etc. I'll work that out myself.
Per Facebook documentation, all desktop apps will need to implement some form of web browser integration, whether embedded within the desktop app or controlled.
See: http://developers.facebook.com/docs/authentication/
Desktop Apps
Our OAuth 2.0 implementation does not include explicit desktop app
support. However, if your desktop app can embed a web browser (most
desktop frameworks such as .NET, AIR and Cocoa support embedding
browsers), you can use the client-side flow with one modification: a
specific redirect_uri. Rather than requiring desktop apps to host a
web server and populate the Site URL in the Developer App, we provide
a specific URL you can use with desktop apps:
https://www.facebook.com/connect/login_success.html.
Don't worry it took me two solid days of trial and error and re-re-reading of the documentation on authentication to finally "get" it.

Writing Facebook apps in C#

I am a C# developer and fancy the idea of writing a C# app or two to integrate with the Facebook API. I read from this page:
http://wiki.developers.facebook.com/index.php/User:C_Sharp
that there's this Microsoft SDK for Facebook Platform that has binary assemblies that I can use to write my C# app. As a start, I want to try out the example mentioned on the above-mentioned page -- one that gets me a friend list.
The problem is: I am completely new to this Facebook development thing and I see I am going to need, at the very least, an API Key and some Facebook service Secret key or some such, to begin writing some code.
Do I also need a developer account? Where do I get all these things from?
Use the Facebook Developers application. With this application you can register a new application with Facebook and manage all your applications as well. Each registered application has associated API key and application secret.
To create a new application click on the + Set Up New Application button.
Note that if anyone gets a hold of the API key and the application secret, they can impersonate your application, so keep those safe.

Facebook Connect and .NET

I have an ASP.NET application and a Windows Service. My ASP.NET application allows for users to allow the application to connect with Facebook. If a user has connected the application with Facebook, the Windows Service will later (sometimes much later) post a message on the user's News Feed. I have two questions:
What information do I need to collect from Facebook?
How do I collect that information?
I know that I will need to save some information back to a database that both the ASP.NET application and the Windows Service can access. I have this approach working with Twitter. But I am trying to figure out how to do it with Facebook without much luck.
Thank you for your help.
You're basically limited to the list of "ids" in terms of data you can "save back to a database". For example, on a connect site, you cannot store their "name" or "about" for more than 24 hours:
http://wiki.developers.facebook.com/index.php/Storable_Data
To actually get the data you'll want to use one of the following API methods:
http://wiki.developers.facebook.com/index.php/Users.getInfo
http://wiki.developers.facebook.com/index.php/Users.getStandardInfo
More than likely, getInfo as getStandardInfo returns you cannot display publicly. You'll of course need to use Facebook Connect to first authenticate the user, then you can query the API using Javascript or an ASP.NET FB library to get API results. You'll find a load of client libraries here:
http://wiki.developers.facebook.com/index.php/Client_Libraries
http://wiki.developers.facebook.com/index.php/ASP.NET

Categories

Resources