What is the difference between the Ping and WebClient classes in C# [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I was looking for ways to check and report the status of a webservice, and came across both these classes. Is there any benefit in using one of these over the other?

Ping tells you whether a machine is accessible.
WebClient allows you to make HTTP (web) requests.
You almost certainly want the latter. Or consider HttpClient - https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118).aspx .
You may find https://stackoverflow.com/a/7523808/34092 useful as well.

Ping sends ICMP echo requests to the target machine. Many machines will not respond to these requests because firewalls. So this is an unreliable means of checking if a machine is running, let alone running the service you're interested in connecting to.
The best way to check if a service is running is to try and use it (without any kind of pre-check) in the way that the service provider intends you to use it. If it doesn't work, then you can safely say that the service is down.

Related

Does an asp.net web service have a maximum number for incoming connections? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I want to stress my .net web service, It feels like something is limiting the concurrent connections I can have.. even when trying from 2 different computers on them server the results were pretty the same. (All of this is done locally, server and clients are on local network so response time is very fast)
So is there a settings I need to change in my server machine to allow more incoming connections?
There are various things that can limit the amount of processing possible, each of which require research to see if they apply. So you might want to add more to your question about what has been verified today.
Regardless, based on your information I would assume that SessionState is enabled. This, with default behavior will limit processing to a single request at a time for each client due to synchronization locks for guaranteed read-write ability. I assume this is the root cause of what you are seeing today. This StackOverflow post talks about this specifically
Others have posted various details in the comments that can help also.
I have found though that load testing is best done from outside sources as well to ensure your entire production pipeline is involved. (Network components, etc)

Protection For Web Service - Is Https Enough? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I want to create a distributed application and I want to be using Web services so that I could consent with the other systems because there will be a version running on mobile and other computer and other smart hours.
But what worries me is being able to protect the application because it would be a lot of data and there will be great to adopt it.
Is HTTPS protocol enough to protect data during transmission and enough inability to eavesdrop on?
my English is poor i use google translate and not very good in that but is the better>
thx
HTTPS should suffice if the whole question circles around the transmission of data between the server and the client. If the data is EXTREMELY sensitive, implement some kind of encryption for the data itself, but in most cases, yes SSL/TLS will do the trick. I would be more worried about getting a proper authentication solution in Place to protect access in the first place.

C#, remote screenshot without client and server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I just tried a program demonstrated in C# on YouTube. The video shows how to build a client/server based program to capture desktop remotely, and it works perfectly. Now I have a question. Is is possible to do the same job without the client/server architecture? Is there some kind of relative windows API that I can access remotely? My imagination is just to click a button on computer A(with specific program) and receive a screenshot from computer B(without specific program) through network. Is is possible? Thank you very much!
The thing is, that when you access "some API" remotely and get result from that "some API" it's called a client / server architecture, where you is a client and "some API" is a server.
You can't receive something if there is no one to give))
If you wanted to ask "is there anything in windows that would give me a screenshot without injecting anything and etc?" - then:
if you don't care about laws, theoretically, you could find some bug in system itself or applications that are running on it, and through them get access to that computer and make it do whatever you want, that's called hacking, the very black hacking, and that type of things are hard to do.
if you care just a little about any of laws and don't want to visit a prison, then the answer is no.

c# notify a running process [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is it possible to somehow notify a running process from the "outside"?
I have a C# program that theoretical runs forever. And I would like to notify it to trigger some action manually. It would be best, if this solution is possible on Windows and Linux (mono).
EDIT:
The solution should work without a user interface
My program is, as for now, a part of web service. On initializing, a new Theread is created, which uses the Task class to stay alive
Take your forever-running-process and let it provide a webservice other processes can call.
You might use any cross-plattform webservice framework like WebApi or ServiceStack to achieve this via HTTP calls. This will even work over the internet (if the machines can reach each other).
There are dozens of approaches. You could also use named pipes for example, or put commands into a database (the other process has to query regularly) or - if you're fearless enough - write/read files to communicate. Be creative ...

Creating domain name checker [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I wonder how to make a domain name checker (testing for availability) for top-level domains?
Eg. to check if the domain: stackoverflow.com or stackoverflow.dk is available or not.
Do I need to be subscribed to a service to do this, or is there some simple magic behind such test?
Thanks
You need to do a WHOIS lookup - see http://www.aspdev.org/articles/build-whois-lookup-asp.net/
It seems there is a protocol for this check "A Domain Availability Check". I am not sure if this is only for the german .de domains or for all domains. Maybe this will help you a little bit.
Your best bet would be to create a webRequest object to fire off a whois request. You can then parse the results from the HTML using regex. I've done this on a number of occasions and it works well (providing the underlying website doesn't change)
an helpfullweb service client
http://www.whoislookup.be/wswhois/wswhois.asmx
referance
http://www.whoislookup.be/using-an-webservice-to-access-whois-search.aspx

Categories

Resources