
Phreak
Avatar/Signature-
Posts
63 -
Joined
-
Last visited
About Phreak
- Birthday 11/28/1982
Personal Information
-
Occupation
Computer Support
-
Visual Studio .NET Version
Academic & Professional
-
.NET Preferred Language
VB.NET
Phreak's Achievements
Newbie (1/14)
0
Reputation
-
Thanks! TimeSpan worked exactly how I wanted. I really appreciate the help!
-
Ok, I found the DateDiff function, but it keeps returning the value '0'. Here is what I have: tTTime = DateDiff(DateInterval.Hour, CType(tSTime, Date), CType(tETime, Date)) I did a debug and checked out the values of the variables when it gets to this line and the values are: tSTime = 14:25:45 tETime = 14:27:40 So there is a difference. Can anyone please help? I am suppose to have this figured out by the end of the day tomorrow.
-
This is kind of weird, so hopefully someone can answer this. I'm populating a listview control from multiple text files, however, I'm getting an error: " An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll Additional information: This collection has reached its maximum capacity. " Here is my code: If iNotFound = 1 Then sTmpUserNms.Add(iNmCnt, aLocVals(1)) Dim Item1 As New Windows.Forms.ListViewItem.ListViewSubItem(iTmp, sTmpUserNms(iNmCnt).ToString) 'iTmp.Text = aValues(0) iTmp.SubItems.Add(Item1) 'iTmp.SubItems.Add(Item2) 'lstData.Items.Add(iTmp) iNmCnt += 1 End If I get the error at "iTmp.SubItems.Add(Item1)". I get it when it is trying to add the 4096 item. And I only get it when I have "lstData.Items.Add(iTmp)" commented out. However, when I uncomment that, I get the error:" An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll Additional information: Cannot add or insert the item '' in more than one place. You must first remove it from its current location or clone it. " Please help!
-
What I'm trying to do is sort through an IIS log file, and add up the total time a user has spent on the site. Each log file is separated by days, and everytime a user opens a new page, the time is logged. So I can have multiple records for the same user with different times. Say for instance they opened "this" page at 10:30:15, and then opened another page at 10:31:25, and another at 10:33:40. How can I add all of these times together to get the TOTAL time a user spent on the site? For instance, the total time the user used in the above example spent 3 min 25 sec on the site. Is there a way to do that? Maybe even easier, put in the 1st time and the last time logged and have it spit out the whole time span?
-
I found this Javascript function and it seems to be working. If anybody finds any flaws in it, PLEASE let me know. I can't seem to find any. <html> <head><!-- Do not cache this page --> <meta http-equiv="Pragma" content="no-cache"> <title>Speed Test - Graphics</title> </head> <!-- This function computes the time it took to load up the page --> <script language="JavaScript"> function results() { var time2, timed, thruput, title time2 = new Date() //Calc difference and convert from msec to sec. timed = (time2.getTime()-time1.getTime()) / 1000 /* Calc Kbps using formula: [throughput (in Kbps)] = [file size (in bytes)] * 8 / [elapsed time] / 1000 */ thruput = (225455 * 8) / timed / 1000 document.open() // Stops the page from loading. document.close() // Turns off the hourglass. title = "Speed Test - Graphics" document.write("<html><meta http-equiv='Pragma' content='no-cache'><title>" + title + "</title>") document.write("<body bgcolor='#FFFFFF'>") document.write("<h1 align='center'>" + title + "</h1>") document.write("<font size='4'><center>Loaded 225,455 bytes in " + (timed) + " seconds.</center>") document.write("<center>Your throughput is <B>" + Math.round(thruput) + "</B> Kbps.</center></font>") document.write("<hr noshade>") document.write("<p align='center'><a href='" + document.location + "'>Run Test Again</a></p>") document.write("</html>") } </script> <body onload="results()" bgcolor="#FFFFFF"> <!-- Start timer --> <script language="JavaScript"> time1 = new Date() </script> <p align="center"><big><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Speed Test - Graphics</b></font></big></p> <p align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Loading 225,455 bytes (compressed JPEG)... please wait.</font></b></p> <hr noshade> <font face="Arial, Helvetica, sans-serif"> <!-- defeat the browsers image cache by appending a timestamp --> <script language="JavaScript"> imgLocation = "images/test.jpg" + "?" + time1.getTime() document.write("<p align='center'><img src='" + imgLocation + "' align='center' width='256' height='256' alt='Loading 225,455 bytes...'></p>") </script> </font> <hr noshade> </body> </html>
-
Anyone have any idea how you could detect the connection speed of someone viewing your website? AND calculate the estimated time for a download of a certain file. I thought about trying to ping the ip of the connection and do some math, but that's not a correct way to configure bandwidth. Anyone have any ideas about how to accomplish this?
-
What kind of configuration information? I'm not really sure what you mean. But I think you might be able to get by with a text file or something that the service can read. I'm pretty sure you can't actually "interact" with the service except for starting, stopping, pausing, etc. the service. Or create a "client" program that communicates with the service through sockets.
-
Well, the TcpClient object that is returned is passed to a Client object from my Client class. Dim x As New Client(mobjListener.AcceptTcpClient) So I made the Client class inherit from TcpClient, and when my Disconnected event was raised (I raised it), the client object is passed to it, and I call the Close method, however it doesn't disconnect. Here is that code: Private Sub OnDisconnected(ByVal sender As Client) sender.Close() UpdateStatus("Disconnected") mcolClients.Remove(sender.ID) End Sub Any other ideas? Anyone?
-
Now you lost me, call the Close method of the TCPClient on the server application that is created by the TCPListner.AcceptClient? Pardon my asking how I would do that? Or do you know of somewhere that goes over this topic?
-
Is it possible, if I have a TCPListener running, and it has multiple connections to it; to force disconnect one of the connections? Example: Billy, Jimmy, and Tommy all just connected to it (in that order), and Billy didn't supply the correct syntax for logging on (potential hacker); is there a way to have the TCPListner or something, disconnect that specific connection?
-
That worked great... thanks!
-
Ok, this is REALLY starting to frustrate me. I have a collection list that contains all 237 countries starting at 0 through 236. I also have a For loopthat fills a combo box with this collection list. Now, all of this is done on the form load event, and I want the default selected start item to be the United States, which has an index of 222 in the combox (after it's filled) and 223 in the collection list. Here is the code (without the list of countries): For i = 1 To cCountries.Count Step 1 cmbCountry.Items.Add(cCountries.Item(i)) Next cmbCountry.SelectionStart = 222 No matter what I do, the drop down combo box never has a default item selected, it's always blank. Any ideas what I'm doing wrong?
-
Hey thanks! That'll do just fine. :D
-
Option strict basically disallows any implicit conversions of data types. The reason for this, is that somewhere down the line (usually after you've already deployed the application), converting one type to another type might cause undesired results and hence, crashing your application. So with Option Strict On, you are not allowed to build your solution/project if you have implicit conversions. Try using CType(STRING, INT) or vice-versa, so you aren't implicitly converting data types.
-
I'd like to allow a user to select their country and state (if from US) from a drop down list. Does anyone know where I can get a list of all the countries so I don't have to manually type in all 200 and some? I've searched all over and can't seem to find a list of countries... any help?