Accessing the database on the server with a windows service - c#

I wrote a windows service that detects usb drives plugged into the computer.I can get data such as computer IP address, transaction date, usb name, plugged and unplugged warning.My goal is to monitor usb movements on computers in the local network.For this I need to maintain a database on a server in the local network.I want this database to be updated when usb is plugged into any computer.How can I do this in a local network specific? What are the steps to follow?I am open to all suggestions.

Related

How to identify if a device (scanner) is local or remote?

Context:
I have a C# application that works with a scanner, on a Windows 10 environment.
In some situation, users would, from their local computer, connect to a remote computer that is running the application.
The application shows a list of scanners that are available, both local and remote.
I need the application to be able to identify whether a scanner is local (connected to the computer the user is on) or remote (connected to the computer on which the application is running).
What I have tried:
Using the DeviceManager object from the WIA library, I am able to get a list of properties (DeviceInfo.Properties) from each device connected to the computer.
One property, PnP ID String, always displays "&rev" for remote scanners.
Example of PnP ID String for a local scanner:
For a remote scanner:
This behavior has been observed with several scanners from different brands (namely Fujitsu, HP).
The "tsusb-session" string found for the remote scanner looked intersting in the first place but is absent when testing with HP scanners.
Also, one of the properties that is recovered is Remote Device ID, but it is always displayed blank.
Is the "&rev" thing a reliable way to identify a remote device ?
If not, is there an accurate way to do it ?

Can two .NET apps on same Windows 10 computer communicate by USB with each other without a USB loopback cable?

So, the 1st app is the USB host, and the 2nd app simulates a USB device.
After that, I would then like to test using a USB loopback cable, which it seems needs a USB bridge -- sometimes called a USB to USB adapter.
Next, I'll test same app running on two computers.
And, ultimately I need to test communication between GUI .NET app on Windows 10 (the USB host) with USB-2 connection to an embedded ARM (the USB device). And, the embedded is not avail yet.

Sharing a folder fails due to WINS name resolution

I am trying to set up a shared folder with an old Win CE 5.0 device I am using to learn and improve my C# skills.
Possible options to do this can be done via console: net use sharedfolder \\mypc /user:foo /password:bar, to start an extra process from my C# application which then runs the console with the previous parameters or by using the function WNetAddConnection3.
However, I receive every time Error 53, ERROR_BAD_NETWORK_PATH.
I have checked the connection, as well as the path - always error 53.
A connection between another PC and \\mypc works fine without any problems. By comparison of my PC's network connection with the Win CE 5.0 device I have found out that there is only one difference: the Win CE 5.0 device has one WINS-server less. After setting the IP profile manually (IP Address, Subnet Mask, Default Gateway, DHCP, WINS), as well as adding the missing WINS-server, the problem disappears and the folder has been mounted successfully.
How can I fix this problem without changing the IP profile by hand?
In a normal network the WINS will be set by the DHCP server. The WINS entry of a network connection can also be set manually.
The problem with network sharing on Windows Mobile (WM) and Windows CE (WCE) is that it does not allow IP addresses, it only accepts windows network names. If you do not have WINS, a netbios network name can be resolved by the network card using a hosts entry, a broadcast or a WINS server.
As you do not have access to the DHCP settings of ActiveSync, you can either set WINS manually or by code or simply add a host entry for the connected PC. The activesync connected PC will can act as WINS server or , when you enter the netbios name for the netbios share server, the device can simply translate the netbios name to an IP. So either use the activesynced PC or the netbios server IP address as a WINS entry or add the name and IP of the sharing PC to the WCE/WM hosts table (registry: http://windowsmobilepro.blogspot.de/2006/04/etchosts-file-equivalent-in-windows.html).
[HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\hello]
"ipaddr"=hex:a1,a3,a5,a9
"ExpireTime"=hex:99,99,99,99,99,99,99
I recommend to use the hosts entry solution and enter the name to use and the IP of the server you want to use.

windows phone 7 wifi , bluetooth

I have few queries aboubt network statistics for application development on windows phone.
1)Is there any way(APIS), we can scan wifi AP in windows?
If it is connected to AP how to get SSID,BSSID and MAC address?
2)how to get CELL ID and local information?
3)Application Layer (TCP, UDP & ICP throughput, latency, etc)?
4) Bluetooth apis for device connected and device?
I was finding very info from msdn.
like Bluetooth connect and discover able devices.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207007(v=vs.105).aspx
coming to (wifi,cellular,ethernet) they have mention common class networkinformatio will it be helpful?
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202867(v=vs.105).aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.net.networkinformation(v=vs.105).aspx
Short answers to big questions:
You cannot find WiFi SSIDs and Mac address directly from the WP8 SDK.
You cannot get information on the physical layout of the cellular netwrok directly from the WP8 SDK.
You cannot get network transport statistics directly from the WP8 SDK.
You can use Bluetooth APIs to enumerate over paired devices and open BT-SPP sockets.

how to get computer IP that connect to my Pocket-PC?

How can I get the IP of a computer that connects to my Pocket-PC ?
I need to see this IP in my Pocket-PC.
I work on VS2008 C# Windows-mobile
Thanks in advance
The ActiveSync connection itself is an RNDIS network, so the device and the PC have their own addresses in that network. You can resolve "ppp-peer" to get the address of the PC in that network, but it won't tell you anything about the other network connection(s) of the PC.
To get that information, you would have to put an app on the PC that the device would talk to, and that app would provide the info you're after.

Categories