how to display speed of internet connection in web application? - c#

I have a asp.net web application that uses C#. It logs in on a remote machine and download files from the server. I wish to display bandwidth available during the connection or the speed of connection.
What could be the best possible way if I m not allowed to use any external library or APIs? How can I implemet it using Javascript?
Thanks in advance. :)

Have a look at the following page:
Determining available bandwidth
It suggests there isnt really an easy way of doing it.
This one has some ideas of how to do it though:
Detecting network connection speed and bandwidth usage in C#
Hope they help.

This article does a good job of explaining how Google Analytics calculates speed.
As suggested by the article one of the easiest to implement but least accurate ways could be to implement / build a solution that matches the users IP address against the ISP that IP address belongs to, then "assume" the connection speed. I personally feel this would be way too inaccurate but it might be enough for your needs, especially if you are working on an application running over a closed WAN.

Related

Throttling network for other applications

A friend likes to limit his applications to a use a certain bandwidth-limit. Seen as he doesn't have the widest connection and - for example - not every application that downloads/uploads has the ability to throttle/limit their downloads/uploads (Like Steam or a torrent downloader.). So he was wondering if I could maybe put something together since I fiddle around with WinForms often. I recommended NetLimiter and NetBalancer, but I was curious as to whether I could make this in C# myself.
I have searched the web and found some decent solutions as to throttling in an application itself but as to throttling applications outside of the current application you have the source code of, I haven't been able to find anything that would help me understand how to program this from scratch.
Do any of you know how I'd go about throttling other applications? Would I have to write my own network interface and have Windows reroute traffic through that?
Thank you for your time.
EDIT: Seen as the first comment tells me I'm at the wrong address with C#, I rephrased my question in the hopes of a better way to get an answer.

SSIS transfer files by ftp with limited transfer speed

I need to transfer via ftp sql server backup with ssis to a limited speed, is this possible with ssis ?
I canĀ“t find anything with google search.
I have a remote WAN location with limited network bandwidth and would transfer without affecting too much the bandwidth.
I need it without Third party applications.
I have been able to see that with the component script in c# you can enlarge the functionality I think that over there the thing walks.
It would appreciate the help of the community
Thanks
Due to the simplicity of many SSIS controls, I doubt there's a way to throttle it built-in.
An alternative may be to throttle the network on the SSIS process, however judging by this question, there may not be a way built-in to Windows to achieve this.
Others have asked this question as well, but as you may have found, it required third party applications too.

monitor internet usage in .net

I want to write a method in C# to check which applications in my machine/server are using internet connection at a particular point in time and if possible, how much bandwidth they are using. Can anyone please help me get a head start on this?
I decided to write an answer because comments are too small.
Well, reading other Q&A on stackoverflow and looking around on the internet, I didn't find a simple solution for your problem.
Actually, for .NET processes is really simple, you just need to retrieve informations from ".NET CLR Networking - Bytes Received/Bytes Sent" performance counters, as shown in this Q&A
But in general, getting per-process used bandwidth isn't an easy work.
For example "Microsoft Network Monitor" sniffer can trace the process that generates internet packets only for TCP traffic, because probably it maps IP-port pairs with processes using them (or something similar, TCP is a connected protocol so it is simpler).
Anyway if you want to give it a try you can use the exposed API (look at this blog entry for some hint).
However, as suggested in these Q&A's (LINK 1, LINK 2), the right, and probably the only way, is to write a NDIS/TDI driver that can intercept network traffic and exposing a .NET callable API to it.
The problem is that such drivers can't be written in managed code, and so you need to implement it in C/C++.
Obviously, if you manage to find an already written driver/sniffer exposing a callable API, you can use it.
For example WinPCap has one (and some .NET wrappers like SharpPCap or PCap.Net), but I don't think (not sure) it's able to get packets's source-process information.
As digEmAll noted, in pre-Vista Windows you are reduced to writing your own driver or using a 3-rd party one. In Vista, 2008 and Windows 7 you can use the GetPerTcpConnectionEStats API (there is a large example of its usage on the MSDN page). Resource Monitor relies on this API, together with the older GetTcpTable/GetTcpRow APIs, for extended network statistics.
I found Process Monitor as a very useful tool and it served my purpose so I didnt had to write any code although i am yet to check out whether it gives any API which i can use in my application to get some information I need.
Thanks everyone for helping me out.

The ideal connection implementation for an internet cafe software

I am coding an internet cafe program and trying to decide which path to take. I've read some articles and came to know that there are a few ways to implement a server/client connection.(a bit messy Asyncronous, simple TCP and Socket) I'm a bit confused. I kindly ask you to show me the ideal way regarding to the needs that I mentioned below
Clients will always stay connected to server and server will know when any client is disconnected. Server will send object and string to clients, clients will send string to server.
So, Should I use an asyncronous or simple tcp or what? Thanks in advance
Have you looked at WCF?
There are quite a few good tutorials out there to help you get started on this.
It sounds like you have the basic functionality in mind, so take a look at this tutorial - hopefully it can help you out.
http://www.codeproject.com/KB/IP/tcpclientserver.aspx
Also you can look this site for basic requirements
http://www.java2s.com/Code/CSharp/Network/CatalogNetwork.htm

how to create a vpn software

I want to create an application which creates a VPN between some endpoints, something like hamachi and i do not have a starting point. I haven't found any resource to explain how to create such a network application.I want to use c# because i have some experience with it.
I really need some help, anything that can put me on the right way. Thanks.
There are a number of distinct elements of VPN software that you'll have to figure out:
What technology/standard will your program use to provide the privacy? Some common ones are IPSEC, L2TP, PPTP, SSH, and SSL. Web searches ought to turn up rich information (including RFCs) on all of these. If you're doing this as a learning exercise, rather than needing actual security, you could also design your own.
Are you implementing a client, a server, or both?
What operating system(s) will you support? This affects what you need to do to convince it to route packets through your application.
Do you plan to interoperate with software implementing some standard?
You might want to take a look at SSH tunneling and see if it solves your needs.

Categories

Resources