Silverlight Browser Application Capabilities for OSX - silverlight

My company has developed a .net 4 WPF application that connects to our manufacturing devices over a local network and controls them, in addition to processing image data and outputting it to these devices from the windows desktop. I have been tasked with porting a bare bones version of this to mac. My options are mono for mac or a browser based SilverLight application.
What is the feasibility of a browser based app that will essentially
-scan the local network for our devices and send commands to the chosen device
-accept images from the local machine, uploading them to our server for processing. We would then send the processed data back for output to the local device and display the final image in the browser.
I'm aware that SilverLight 4 Elevated Privileges allow connection across a domain without port number limitations. However I am unsure about scanning a network from a silverlight app running in safari.

-accept images from the local machine, uploading them to our server for processing. We would then send the processed data back for output
to the local device and display the final image in the browser.
Silverlight app can't access files from local machine without user interaction. OpenFileDialog class can't be user initiated. you have to select files from local machine to upload to some service.
-scan the local network for our devices and send commands to the chosen device
as far as scaning local network is concerned, silverlight don't offer TCP ping. if your devices offer some interface using http you might be able to connection and send commands to devices using WebClient.
Further last but not the least silverlight is not full supported in MAC OS described by microsoft. so you might face weird issue that will remain unfixed. Check System Requirement here http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx
Regards.

Related

CAN Communication

How can I implement CAN communication in c# windows application. I have to create an application that communicate to the device. In earlier project I used serial port. What will be the major difference between these two.. Am new to this topic.
You need a CAN controller. I would recommend the PCAN USB from PEAK Systems.
Install the drivers
Download the PCAN API from PEAK System web page. (contains C# wrappers)
Use the API in your application to send and receive CAN frames

Discover location of database

I am trying to find the location of the database where a particular website is saving to.
The website is saving to some local database in our system, but I am unable to discover where.
I have tried using WireShark to find the IP of the machine where the website sends data to (i.e. the machine which has the database) but currently the only packets showing up are those from the website to my machine and vice versa.
Any ideas?
Thanks
I would start by tracking through the code & website config. If you have sufficient access to run Wireshartk on the host can you not search for config files, find the serverside code, etc?
If you can't see packets on the network interface and you know you've found all network interfaces then it would appear possible the DB has to be on the same machine. Check for recently changed files with you favourite tool (Windows explorer/search, find on Unix, etc).
Is it caching so you haven't yet caused it to read/write to a remote DB while watching? Try watching Wireshark at boot up.
Depending on the nature of the data it could be an in memory DB or something that reads from a disk file into memory at boot up.

Save Data using Dynamic C

I am using Rabbit single board computer. I would like to save the data I/O which is connected to another Rabbit single board computer through a wireless connection. Is it able to save the data inside the PC in a .txt file for example?
If you can establish a connection to a PC, and the PC is running some server to log data, yes, you could save to a PC. For example, the PC could run a TFTP server or FTP server on the same wireless network, and you could connect to it from the rabbit SBC and save whatever data you need to.
Yes, this is possible.
There are two parts to this scenario. Your embedded app needs to know how to connect to a server application running on the PC or network, and you must, of course, have said server application running on the target machine.
If you're sending entire files, FTP, as bdonlan suggested, is a good way to go. The protocol is well-understood and you can probably find a library to wrap it for you.
If you need to log data real-time, you'll need to have some sort of application which can receive messages or accept a socket connection, and a protocol to get the text across the wire(less). A web server may be a good way to do this, because you can POST chunks of data to the server with a simple HTTP request, and the server app can decide how to organize and store the information. Once you have a web server running, you may find it beneficial to build some pages that provide basic reporting functionality, so you can see the logged data from any web browser.
This could be less restrictive than FTP, but will require some web development expertise on your part.
Any reasonable solution is going to require that you already have a connection to the wireless network with a correctly-configured and functioning IP stack. Without that, you're probably out of luck connecting to any networked resources.

Alternative to SendKeys when running over Remote Desktop?

I have an application which injects keystrokes into applications via SendKeys.
Unfortunately, the application will not work when I am running it via Remote Desktop
because of the well known issue that SendKeys doesn't work with Remote Desktop.
Has anyone solved this issue before, or have any good suggestions on how to resolve it?
SendKeys is not a good fit mainly due to:
It can only send keys to active/focused application, which is never guaranteed to work because the the active application can change between the time the keys are actually sent.
RDP and many other libraries (e.g., DirectX) block them mainly for security reasons.
Better alternatives:
Use SendMessage or SendInput for simple needs
Some good examples of how to use SendMessage can be found:
Send strings to another application by using Windows messages
SendMessage via pInvoke
How To Send Keystrokes To Extern Win Application
For more elaborate needs, it is recommended to use WCF
To get you started, read this Basic Tutorial that talks about Inter Process Communication
Sample code using SendMessage:
HWND hwndNotepad = FindWindow(_T("Notepad"), NULL);
HWND hwndEdit = FindWindowEx(hwndNotepad, NULL, _T("Edit"), NULL);
SendMessage(hwndEdit, WM_SETTEXT, NULL, (LPARAM)_T("hello"));
In my case I was successfully using WinAPI's SendInput with hardware scan codes. It seems like SendKeys maps chars to scan codes incorrectly.
You can workaround RDP issue by having desktop always logged in before use (or configured for auto-login # every boot).
And even with the auto-login, if you ever need remote desktop access to run automation, or manage system, etc., the preferred method is using VNC for remote access rather than RDP. Reason is VNC is cross platform and you won't run into this RDP issue. VNC works like a relay of your actual desktop (RDP console session 0 or the "head" of the machine), the disadvantage being one remote session at a time only (or you all share the same desktop + keyboard + mouse). VNC will work for virtual machines too. Use VNC instead of RDP or local (RDP) access from the (VMWare/Hyper-V/Xen) virtual machine manager software.
The only thing to watch out for with VNC still is that the desktop not be configured to auto-lock on idle or screensaver, that may also stop send keys and GUI automation from running, so be sure to disable that. Screensaver & monitor power save is ok, just no auto-lock & password protect.
NOTE: I'm not sure, but believe since VNC relays the desktop "as is", it is the same as executing locally from the app/system's point of view, so it should in theory also be able to fool the system/app that doesn't allow SendKeys via RDP. I've had no issues using this VNC method for AutoIt + SendKeys, whether I was actively connected via VNC, or disconnected (sendkeys/automation still continues to work after disconnect because on the actual desktop, it's still logged in, just that VNC not active).
In my case I was using sendkeys as part of test automation. It would not work from my build machine, where the build agent runs through remote desktop protocol. I'm not happy about it but I was able to skip that test as part of my automated builds.
Using Win32 calls to send window messages might work, if I have time I may try that someday.
Anyhow, here is the check to see if the current code is running in a remote desktop session:
System.Environment.GetEnvironmentVariable("SESSIONNAME").StartsWith("RDP-")

Connect to digital camera from cellphone?

A customer (photographer) asked me, if it was possible to write some kind of software for cellphones, so he could physically connect it to his professional digital camera (Canon or Nikon) and transfer the pictures (or a subset) to the cellphone.
I am trying not to put constraints on cellphone platform (Symbian, Windows Mobile etc) from the beginning, so I am leaving that sort of constraints out on purpose.
Can anybody give me some hints?
You need a connection between the camera and the cellphone:
Some windows mobile devices got a USB-Host-Function, so you can connect either a cardreader or the camera itself via a usb-cable and read the files from the device. I never heard of a symbian-device which supports usb-host, but there might be some.
If the camera supports either bluetooth or ir, you could use these protocols to transfer the files as most mobile-phonse support this.
If you got a connection (and the protocol-support by your platform) it is easy to write a application to transfer the file from the device to you cellphone. You can write this application in any supported language (java for j2me, python (symbian), .net (windows mobile)
My digital camera saves photos to a memory card. I can simply take the memory card out of the camera and insert it into my Windows Mobile phone and view the photos on the phone.

Resources