|
By coming up with a GOOD set of requirements (hint: FAR more than what you have in your post), designing a solution that fits those requirements and writing code to implement the solution.
|
|
|
|
|
I am trying to monitor network bandwidth usage on a per user basis and am new to vb.net. I have a list of users with their IP addresses already if that helps.
Basically trying to mimic the remote desktop service manager.
I am lost when it comes to this so any information about how to accomplish this would be greatly appreciated.
Is this even possible?
modified 13-Nov-12 11:54am.
|
|
|
|
|
DinoRondelly wrote: Is this even possible?
Hard to answer; when I use "Fiddler" to monitor the traffic, I can see what's going on in detail. There's probably examples on using the same "winpcap" from .NET here on CodeProject.
Still, I think "time" is more frequently (and easier) used to limit the users' access.
|
|
|
|
|
Hello All -
I have seen on this site Article 42852 / Reading-Barcodes-from-an-Image-III, however, this appears to only read the first page of a multipage tiff. I need to find something that can read all the pages (could be a 500 page tiff) for barcodes. Also, does anyone know of a sample project on this site (or any other site) with source code to do this and scan a folder of tiff images instead one at a time.
Thanks in advanced.
|
|
|
|
|
daveofgv wrote: I have seen on this site Article 42852 / Reading-Barcodes-from-an-Image-III, however, this appears to only read the first page of a multipage tiff. I need to find something that can read all the pages (could be a 500 page tiff) for barcodes
If you need to find it, good luck.
To create it;
- Isolate the trick from the article to a minimal console-app
- Try fetch total number of pages on a given TIFF file
- Try fetch specific page of a given TIFF file
- do trick N times, while showing progress bar
daveofgv wrote: Also, does anyone know of a sample project on this site (or any other site) with source code to do this and scan a folder of tiff images instead one at a time.
It'll be quite expensive to do them "all at once", it there's over a hundred. Doing above trick for each file in a directory, is explained here[^]
|
|
|
|
|
I am trying to get all logged on users and their IPAddresses and display them in a data grid veiw in a windows form using VB.net I have tried the below code and it appears to get the users on a windows 7 machine but not on servers. Any information on this would be greatly appreciated.
Public Shared Function GetUsers() As List(Of Users)
Dim UserList As New List(Of Users)
Try
Using searcher = New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_LogonSession WHERE LogOnType = 2")
For Each queryObj As ManagementObject In searcher.Get()
Dim qry As String = "Associators of " _
& "{Win32_LogonSession.LogonId=" & queryObj.GetPropertyValue("LogonId") & "} " _
& "Where AssocClass=Win32_LoggedOnUser Role=Dependent"
Using iSearch = New ManagementObjectSearcher(qry)
For Each res As ManagementObject In iSearch.Get()
Dim ret As New Users(res.GetPropertyValue("Name"), _
"", "")
UserList.Add(ret)
Next
End Using
Next
End Using
Return UserList
Catch err As ManagementException
MessageBox.Show(err.Message)
Return UserList
End Try
End Function
|
|
|
|
|
Unless the users are logged in on Remote Desktop (or Terminal Services) to the server, this code won't show you anything on the server.
LogOnType = 2 is Interactive logons only. Remove the WHERE clause and see what you get.
|
|
|
|
|
Thanks so much for the reply
What I am trying to do is determine all users logged on to a server and then get their IPAdresses and any other information I can get on them.
I did what you suggested but for some reason this also included Local Services,Network Services and others in the list of users. Also every user in the list was triplicated.
This is the first project I have done in VB.net so forgive me if i come off as a novice.
Any information or code samples would be greatly appreciated.
|
|
|
|
|
and what were their LogOnTypes??
I have no idea what kind of user you're looking for! "Logged on users" can mean anything depending on HOW they are logged on. Are they remote desktop sessions? HTTP Sessions? Mapped drives?? Each of these is a different logon type and needs to be handled differently.
|
|
|
|
|
Thanks for the reply,
I am trying to get all users that are on the server that have remoted in and their IPAddresses. Similar to what is showing in the task manager under the users tab and in the terminal service manager.
|
|
|
|
|
That's obtained from the WMI provider for Remote Desktop. You're using the LogOnSession class, which is a bit too high level for what you're looking for. You can find the docs on these classes here[^].
|
|
|
|
|
Thanks for the reply,
I will look into what you have suggested, do you by any chance have any code samples of how this works? If not no worries,
Thanks!!
|
|
|
|
|
Nope. I've never had to do what you're doing.
|
|
|
|
|
http://www.codeproject.com/Articles/111430/Grabbing-Information-of-a-Terminal-Services-Sessio
Works perfectly
modified 12-Nov-12 14:46pm.
|
|
|
|
|
Great. Glad you got something that works for you.
|
|
|
|
|
hi experts!
can you help me with this problem?
i am making an id monitoring system.
here is the error.
"The type initializer for 'again.Module1' threw an exception."
thank you very much.
|
|
|
|
|
Not enough information.
We need to see the stack trace and the code for "again.Module1", which I think is a mistake in your code anyway. But, we'd need to see the code where this error pops up.
|
|
|
|
|
I'm doing a homework which i need to create a pizza order form. I've created the form along with the codes but i'm getting errors when debugging it. Like the one below:
C:\Users\Vasquez\Documents\Visual Studio 2005\Projects\Pizza Order\Pizza Order\Form1.vb(113) : error BC30451: Name 'txtSurname' is not declared.
This is the code to it:
If ds.Tables("CustInfo").Rows.Count = 0 Then
MsgBox("Number not found in database.")
cmdSave.Enabled = True
txtSurname.Focus()
Exit Sub
I wish i could put more but i'm limited to what i can post cause it long and i have other errors as well!
|
|
|
|
|
You (presumably) are trying to set the focus to some control on your form, but you do not appear to have a control named txtSurname . Check the spelling of your controls.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello !
i have an application in vb.net 2010 , and i'm using System.Net.Mail to send emails.
is there any way to test smtp connection , before begin to send emails .
Thank you !
|
|
|
|
|
The only way to really test it is to try and send an email. Kind of defeats the purpose now, doesn't it?
|
|
|
|
|
thank you , but i need to check if smtp server is ready , and if not i need to display a warning to user and cancel the sending process. If is ready i can begin sending emails.
i have found this code , but doesn't work when i test with a invalid smtp server name:
public bool ValidSMTP(string hostName)
{
bool valid = false;
try
{
TcpClient smtpTest = new TcpClient();
smtpTest.Connect(hostName, 25);
if (smtpTest.Connected)
{
NetworkStream ns = smtpTest.GetStream();
StreamReader sr = new StreamReader(ns);
if (sr.ReadLine().Contains("220"))
{
valid = true;
}
smtpTest.Close();
}
}
catch
{
throw;
}
return valid;
}
|
|
|
|
|
If you give the Connect method an invalid hostname and port that cannot be connected, it'll throw a SocketException with the error code in it.
if the hostname is a real server but nothing is listening on 25, it'll throw a SocketException.
If the hostname is real and 25 is blocked by a firewall, you'll get a SocketException.
Sooo... what's with the lonely little "throw" statement? Remove that and your code will work. That is, assuming that the SMTP server is listening on port 25...
The problem with this code is that you're only testing the server connection, not the ability to send email. Just because the server responds to a connection request does not mean that the credentials given for the SMTP account to send an email will work.
That's why I said the best way to check is to actually send an email.
|
|
|
|
|
Using Vb.NET 2010
=============
I am trying to create a function that given a specific URL (like: www.foo.com/bar.htm) will return a Boolean if there are any JavaScript errors. I would LOVE it to return what those errors are as well, but I only need to have it return a yes/no if there are any.
I've searched high and low for any information regarding this topic and just haven't found anything about detecting if the HTML page has JavaScript errors.
Would anyone have any suggestions, ideas, or code that might be able to help me with this idea?
Thank you in advance!
-== The PogoWolf ==-
|
|
|
|
|
I currently have an XML file that contains about 115,000 codes along with addition information (description, "see also" information, etc), and is about 8.5MB in size. Unfortunately I did not create the file and cannot change it's format; must be used as is.
I've never worked with a file of this size. Just trying to open the file to look at the format was cause slow-down while opening and trying to scroll through it. However, for my application, I need to be able to dynamically update drop-down list with the codes (as the user starts to type in a code), as well as do search for codes.
I'm thinking this file is too large to load into an XDoc object or into a custom sorted list (key=code, value=description). I'm hoping someone has had experience working with similarly large XML files and has some suggestions on the most efficient way to work with a file like this.
Thanks in advanced for any help you can provide.
|
|
|
|