Trying to detect a windows user switch and close a serial port - serial-port

I have a application I wrote that uses a serial port (hand scanner connected to it) and I need to detect somehow that another user switched so I can close that port and when the new user logs on to the application it wont get 'port in use' error. Any suggestions? My program is in VB.Net but open to any suggestions.

This is a common issue unfortunately.
I find the best thing to do is create a Windows Service to handle all of the comms so that it works independently of any user being logged in. You can use a WCF/Web Service to get data out of the Windows Service.
I hope this helps.
(I would have posted this as a comment instead of an answer if I could)

Related

Is it possible to us RxAndroiBle, autoconnect in foreground?

I will try to post a question since I want to use RxAndroidBle. I want to connect to a device even though I am not running my application, I don`t mind if any service is running. Moreover if possible when I get close to the device with my phone, it automatically launches the application. What would be the drill for something like this?
You could register broadcast receiver with specific filter which will wakes up your app when BLE device is available

how to block telnet somehow

Scenario:
Scenario:
In this part we have two System Administrators who administer a system which has
windows OS installed. First Admin is beside the system and second Admin is on
vacation. Both have username and password. In a negligence, second Admin left his
notebook containing login information and Server IP in a CafeNet. An intruder from a
black hat hackers group found it and decided to go another unknown place to access
the server using telnet. But that takes 10 minutes to get there. Imagine you informed
right from beginning minute. Now help first Admin to configure the system in a way
that while receiving any telnet connection, it warns the intruder with a message and
let him know that we have already covered this security hole. But, if it was a request
of second Admin (he calls or chat you!), then we let him to go ahead with telnet
connection!
Note: For some reasons, we can not stop Telnet, or change password today!
Well from the command line there is no way to do that, but I guess that you could make an application that would be capable of doing so and apply that to the Telnet server. Telnet cannot specifically be commanded to warn an intruder, it can only run the commands that it was intended to do.

Networking. Making a program available through the internet

I want to create a program in which a user enters data and saves it on a text file. For example they enter a name and their age and it saves it and loads it. The thing is that i want this program to be available to the user at all times on any computer which means having the program online.
Do i need to make the program have networking capabilities? Or can i just have a server or host computer to hold the program and have the client access that directly?(like using the spreadsheets from google).
I don't know what you mean by "do I need to make the program have networking capabilities". If you choose to avoid the web site route then you need to have a server and client side app. If you want the program to be able to save data to a server then you need to do some socket programming.
To create a server, you need to:
create a socket
bind the socket to an address and port
listen for incoming connections
wait for clients
accept a client
send and receive data
To create a client, you need to:
create a socket
connect to a server
send and receive data
Hope this helps!
There are may ways to accomplish your goal, but the route that is probably easiest and most useful is to create a web page that implements this functionality.
Some of the many benefits include
No special software to install. Just requires a web browser.
Runs on any platform (including mobile) that has a web browser.
No software updates to push out to users. Update your website, and everyone gets the latest code.

how to produce an artificially ping "request time out"

I want to produce a request time on internet of a machine, its for testing purpose for an application what happens when internet suddenly time outs.
Updated
system is windows server 2008, i want to do it manually just to check if the winform application keeps dispatching emails if there is a sudden ping break
You can simulate it by (a) ignoring the reply, (b) filtering out the reply packet in firewall. Depends on your system.
Could your developer not just throw a ping exception in their code? obviously you haven't mentioned the programming language as #Tim S commented, but in C# there is a PingException class - MSDN link .

AIR/Flash Player connect to another machine without cirrus/stratus

Is it possible to connect to a Air app running on another machine via socket(assuming we know ip) or some other mechanism(which doesnt use Cirrus/stratus)? If it is can someone please help me on how?
Let me rephrase question, I dont want to connect to a server over socket. I would like to know if it is possible to connect from one AIR app on machine A to connect to another AIR app on machine B via sockets without cirrus. I'm not asking for someone else to do my work, I couldnt find any documentation or possibility of the above thing. My conclusion now is that it is not possible, but I would just like it to be verified by other people(experts).
Absolutely, as3 supports sockets. http://www.ultrashock.com/forum/viewthread/81676/
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6
There are two ways to do it. One AIR app can act as a server by creating a ServerSocket object while the other app connects to this with the Socket class. The other way is to use the DatagramSocket class.
In both cases, the trick is that because of network access translation, the IP address to use is not always easily discoverable unless at least one of the computers has a static IP. If both computers are on the same network subnet you can look up the IP address needed to reach one computer from the other manually. Otherwise, the IP one computer must use to reach the other won't be the same IP that the computer sees for itself. This matchmaking is the service that stratus/cirrus provides.
See http://www.brynosaurus.com/pub/net/p2pnat/ for a description of the problem.

Resources