developin web app using .net need Info about Local System - c#

we are devoloping a web application using c#.net,ASP.Net 3.5,in that we need to know the infomation of local system like what are the installed printers? is there any way to get the data using any scripting Languages? Plz let me know if any body knows the answer.
Thanks in advance
Prasad

we are devoloping a web application using c#.net,ASP.Net 3.5,in that we need to know the
infomation of local system like what are the installed printers?
Are you? Why do you formulate this as a question. Are you not sure what you are doing?
is there any way to get the data using any scripting Languages?
Maybe, maybe not. Irrelevant, though, as ASP.NET is not using scripting langauges on the server anyway. Your server sidel ogic will be ni C# or VB.NET likely (or any other .NET langauge) and by all means this is not a scripting langauge.
if yuo talk of the client side (i.e. from the browser: no way, and you have no busienss knowing. The internet is not a friendly place. Whatever rights you think you want can be abused by some bad person. And will be.
Plz let me know if any body knows the answer.
Yes, someone knows the answer. Which answers yoru question. Note: you did not ask for an answer, you asked whether anyone knows the answer.
Now, real:
Yes, you can. WMI is your friend. The main problem will be:
Understanding the WMI documentation. WMI is the Windows Management Instrumentation and you can prettya much see everything of any computer you can connect WMI to there.
Configuring IIS to allow you local access.

I guess that will help:
How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...)

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.

Quickbooks Desktop SDK Perofrmance

We are using the QuickBooks SDK to communicate with QuickBooks desktop.
It could take very long (like more then about two minutes) to retrieve results from QuickBooks , or to update a single record,
so my question is as follow:
is this a normal behavior?,
does anyone have a workaround for this problem ?
more info on our QB file its about 200 megabyte and the file is stored over a local network .
The QB desktop SDK is a nightmare, developed by an XML enthusiast who doesn't understand OOP. The documentation actually argues with users about why it's better that things are done this way. To be fair to the SDK team, they inherited an ancient, homebrew datafile system (that was probably created by generalist programmers) and had limited options. QB Online is essentially Intuit's effort to re-engineer the backend, hopefully using proven RDBMS products this time!
So, to answer your question directly, the only workaround I know of is to dump QBD for QBO or another accounting platform.
is this a normal behavior?
For many situations, yes. You didn't really give much in the way of specifics, so there's not really much else to say here.
does anyone have a workaround for this problem ?
The same solutions anyone would have for any other resource- or time- intensive job.
Batch jobs. Caching. Async communication.

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.

.NET Compact Framework Connection String encryption/securing

I'm writing an application in C# for a smart device running Windows Mobile 6.1. It's pretty basic. Just querying a database and getting results. Nothing too fancy.
This program is only going to be deployed internally, but we still want to be secure with our SQL connection info.
What's the best way I should go about encrypting/securing my connection string in the program? I've seen examples for .NET programs using AppSettings, but I'm not seeing a Setting stab in my Solution properties.
This is my first time developing an application in C#/Visual Studio 2008, so there might be some kind of setting I'm missing.
Thanks for the help.
Be aware that if it's in your program, then it's inherently unsecure. No matter what you do, if the app has the ability to make that secure connection with info it contains, then that info can be pulled out by an experienced hacker with time and desire.
But are you that concerned about that level of threat? Obviously just throwing it into an app.config file is about as low-security as you get. All that has to happen is that someone opens the file with a text reader and ta-da, they have your credentials.
Maybe you would want to store an encrypted version in the config file and keep a private key in your app. At least a text reader can't "break" it. Of course someone might use reflector and decompile your app to get the private key.
Well you could obfuscate the app. That would make it harder to find that private key. Yes still not impossible.
Maybe you want that private key to be pulled off of a server through a web service or something. Then if someone has the app, they can't get it - though they can always reverse engineer how the web service call is made. Or do a man-in-the-middle and look at the key on the network.
Maybe you could use SSL to protect the transmission. Maybe do MAC filtering on the service to make it more difficult for an unauthorized device to get the key.
You can see the progression here. Each level of security requires more and more work. More and more maintenance. You have to decide what the return on the investment is going to be for your scenario and pick a level of security you're comfortable with for the amount of effort you're willing to spend on it.
Not sure if this helps, but I used OpenNETCF.AppSettings in a previous Windows Mobile 5 project under VS2005.
You can download the Community Edition of the OpenNETCF Smart Device Framework for free at www.opennetcf.com and browse the documentation.
I'm not sure it works with VS2008/CF3.5 though.

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