Testing Socket Programming in C# on Windows Mobile 6 Emulator - c#

I need to develop and test an application in Windows Mobile 6 for socket Programming in c#. I have done it in Windows Desktop application (i.e Creating a Windows Console Application that acts as a Server and listens. Then a Windows Form Application that is the client. Has a button and textbox. When i press the button the client gets connected to the server).
Now i have no idea how to check socket programming in windows Mobile 6. (Building a WM6 application that acts as a client and another that acts as sever something like that or should i be using a different approach? I am clueless)
Thanks.

If you just want to test your Windows Mobile 6 client then you can simply connect it to your Windows Desktop application. Click on File > Configure > Network and check the Enable NE2000 option. You can see this blog post to find out how to install the NE2000 driver.
Using Windows Mobile 6 as a client and Windows Desktop as the server is fine. If you want to use the sockets over GPRS or CDMA then you should be aware of the fact your mobile device will likely have a dynamic IP (which can change as the handheld roams to other wireless networks) and will be behind NAT, so it can be difficult to push data out to the handheld without some kind of connection to the server initiated by the client.

Related

Communication channel between a windows app and UWP app

I have a uwp project and a windows app (net5).
Both are installed in the same machine (same will happen in production), but the uwp is installed using sideloading, not on windows store.
The windows app gets some data by listening to a wss port. I have to pass those data from the windows app to the uwp app and also wait for a response back from it.
To do this internal communication I came across the AppServiceBridgeSamples in this repo https://github.com/microsoft/DesktopBridgeToUWP-Samples but it is outdated and I can't use it.
Is there any alternatives to it? What would be the easiest implementation to achieve this?
Any suggestions/comments are appreciated.
Currently, the general way to implement a communication channel between a UWP app and a windows app is by using App service. This is not outdated. If you don't want to use the App service, you have to build your own socket server so that both of your apps could communicate with it. Another way is that your windows app could save the data in a local file and load them in the UWP app.

Capture Keyboard events with an ASP.NET MVC application from the server PC

I have an ASP.NET MVC application hosted on a Windows 10 machine via IIS Express and I want to be able to capture keyboard strokes on the server computer (not the client side from the web browser window but the server itself).
I tried MouseKeyHook library which works fine on global events on Winforms projects but not in ASP.NET MVC projects. Is there any other way to do this?
Update:
I ended up self hosting the web app from a console app and IIS Express and then configured the barcode reader to work as Serial USB device rather than a HID Keyboard, SerialPort object is used to communicate with it, much faster and more elegant than keyboard strokes.
In my opinion, there is no way to fulfill your requirements. iis or windows service application can not capture user interaction. no matter it is a mouse click or keyboard interaction.its not allowed.

Converting a C# app using long poll to use Websockets on windows 7

I have an existing desktop application that uses long polling to receive notifications to use websockets. My development is on Windows 7 I have a websocket server running out on our network. When I would like to replace the notifications to use websockets, and this only needs to be a listen only.
I everything I find says websockets are only available on Windows 8.
Is there no way to create a listen only websocket connection to an existing web socket server?
If windows 8 is only development, can it be build on windows 8 then deployed to a Windows 7?
Is there a work around that does not involve third party installation?
I am afraid not. System.Net.WebSockets is not supported on Windows 7. So if you try to run an application that uses that namespace, no matter if it is server or client, it will throw a PlatformNotSupportedException.
You will need to install a third party client to be able of connecting to a WebSocket server.
Take a look at
https://github.com/sta/websocket-sharp
https://github.com/Olivine-Labs/Alchemy-Websockets-Client-Library
http://websocket4net.codeplex.com/

Data forwarding server

I have the app for Android and another app for PC, both were written by me. Android app connects to the PC app, and the PC app sends data (in realtime) to the smartphone.
The problem is: if the PC is connected to the mobile wireless network, I can't get its address, so I can't connect my Android app to the PC.
So, is there some simple application (for Windows), that I can use as a server for data forwarding. PC and mobile App will be connected to this server (launched on the station with the static address), and the server will just forward data from one app to another?
Or maybe there are good tutorials for creating such kind of server on C#/Java?
I would use a third pc (a server) that acts as a bridge for Android and PC. I wrote a web service in .NET for a virtual server on the internet. Both Android and PC know the ip address (or the domain name) of the server.
The PC talk to server using .NET native web service call, the Android uses ksoap.
For more infomration about ksoap for android look here:
http://code.google.com/p/ksoap2-android/
EDIT:
I suppose you can have the web server in the pc but you need to configure your modem to forward specific ports to the pc. But if you have no static ip address you need to reconfigure the ip address on Android device everytime your modem is rebooted (or switched off/on). You can also try to use dynamic dns services...
Check this out:
http://whiletrue.blog.com/2013/07/11/smartphone-as-pc-controller/
I've made this with Muzzley. Basically, you already have most of the work done if you integrate with it.
(disclaimer: i work for this project)
On the PC side, you can use the lib to include in you pc app in several languages:
(java) http://www.muzzley.com/documentation/libraries/java.html
(.NET) http://www.muzzley.com/documentation/libraries/dotnet.html
(nodejs) http://www.muzzley.com/documentation/libraries/nodejs.html
On the smartphone side, you can use any of the existent widgets (virtual interfaces):
http://www.muzzley.com/documentation/widgets.html
or eventually make your own:
http://www.muzzley.com/documentation/widgets/webview.html
Example:
You can pull from github several examples here:
https://github.com/muzzley/muzzley-demos/
(check the the webview example)
I hope it helps.

Connect to Windows app with WebRequest

Is it possible for a windows mobile phone to use WebRequest to connect to a windows client application. I mean an actual windows forms application.
I want to use webrequest but the client application cannot be a web app or anything, it has to be a windows forms program. So, is it possible?
Thanks
Possible, yes. Easy, or a good idea for that matter, no.
If your WinForms app also opens up a Socket and listens for requests on port 80.
Essentially you have to build a web server into your WinForms application and then deal with firewall and security issues of the traffic getting from the Mobile Phone to the computer running your application.

Categories