I am trying to figure out how to show the round trip time it took to ping a server. I know the following code conducts the ping and that the 1000 is for the miliseconds however I can't seem to figure out how to capture the time it took.
Code:
If My.Computer.Network.Ping("www.whatever.com",1000) Then
MsgBox("Server pinged successfully.")
i am caching objects, if i make linq queries on cached entities then... will theses queries make database round trip due to lazy loading in Entity framework?
I am trying to write a program to ping computers on my network to see if they are turned on. So far i have the following:
Code:
If My.Computer.Network.Ping("192.68.0.5") Then MsgBox("Computer is on.") Else MsgBox("Ping request timed out.") End If
If i use ip addresses, this works fine but i would rather use hostnames due to the ip addresses being dynamic (something which is outside my control). Using the hostname, it reurns "Computer is on" if the ping is successful, but if the hostname cannot be found, instead on returning "Ping request timed out", an error occurs as follows:
A first chance exception of type 'System.Net.NetworkInformation.PingException' occurred in System.dll
I'm trying to write a file in chunks in a loop but the filestream.write just causes the sub to end the second time round but the first chunk it written and the savefiledialog remains?
edit: I was using an offset which I shouldn't have so now it writes the file just fine but the savefiledialog doesn't close itself?
i have tried altering some code i have to ping an ip address and store the result in an access db.i had it working when i had the ip hardcoded in as a string but I am now gettin an error.instead of having the ip address hardcoded in to the code i want it to be read in from the access db but im now getting this error:System.nullreferenceExceptionbject reference not set to an instance of an object at...button1.click event args ei have underlined the piece of code i tried to change
How would i get the primary key id number from a Table WITHOUT making a second trip to the database in LINQ To SQL?
right now, i submit the data to a table, and make another trip to figure out what id was assigned to the new field (in an auto increment id field). I want to do this in LINQ To SQL and not in Raw SQL (I no longer use Raw SQL).
also, seond part of my question is: i am always careful to know the id of a user thats online because i'd rather call their information in various tables using their id as opposed to using a guid or a username, which are all long strings... i do this because i think that SQL Server doing a numeric compare is much (tentative use of the word 'much') more efficient than doing a username (string) or even a guid (very long string) compare.
im trying to make a program that connects to several websites and parses some information out and then add the information to a listview list.The listview have 2 columns: Site and Nuts. So i load a bunch with urls in the site columns (that isnt a problem) but the problem is to take 5 websites at the same time and connect to them and then write "OK" in the Nuts columns.
In VB6 i could easily make 5 sockets, and then move down five items in the listview, save each of the listview text to a variable and connect to each variable with different socket, but how i add the information to the column "Nuts" is also a challenge in vb6. In the other hand, in vb.net i haven't yet got the skills to do so.
The idea with this form is to add the futures which is calculated when the button is pushed but I need the list to update every time and show the values each time to which the previous value is added to the new calculation, e.g. of what it should look like in listbox:
Year 1: $1,290.93 Year 2: $2,724.32 Year 3: $4,350.76 etc....
I have been working on this a while and I am at a standstill, I was given a function to clear the form everytime it calculates but I don't know how to implement it, I am new to VB. Here is what I have so far:
Public Class frmFutureValue Private Sub btnCalculate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnCalculate.Click
Basically i'm trying making a task manager program for myself. I want to know how I can display a message box and or play a sound when system time = time displayed in listview. I have used a dropdown box for the user to select which option they would like to select - sound or message box to popup. The data for the task will be stored in a listview box. I want it so that when the date and the time is = to the date and time set for the reminder the action will follow.Here is my code so far:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim notext As String = "" If TextBox1.Text = notext Then[code]....
I m into automation development of FMCG products using Micro-controllers. I get real time data Barcode 2D from TCP/IP connection. My task is to compare the result do some Computation with them and Store the incoming Barcode and results into a Excel sheet in a folder. I m successful with the basic working. Am currently working at slow speed of 1 barcode(22 char info) per second from the TCP/IP data (barcode scanner). Now, comes the real issue. I need to process atleast 5 barcodes per sec ( <200ms per process). I m partially successful with 3 Barcode per second(300 ms per process). so, thats like 300ms per processing. I need to achieve less than 200ms for entire processing. I have used threads and timers. but I m unable to achieve. Seems like storing in Excel takes more than 250ms. Since i come from micro controllers background 1msec is a lotta time to process for me. I m not sure how much time does it take and trust me i find it difficult to guage the time here.
With the following problem which I want to round up the "TotalVolume" and "AvgHL" with 2 decimal places. However, my ListView2 is still showing as the following example.
Example: ID --------- Average H/L ----------- Average Volume 12 --------- 1.230000 ----------- 4251.230000 17 --------- 0.560000 --------- 12345.560000 23 --------- 0.320000 --------- 2345.010000 54 --------- 1.230000 --------- 122.550000
Dim conn As SqlConnection conn = New SqlConnection(Source)
I am using VB2008 Express and am curious how to send a command via RS232 communications. The string that I need to send is 02h PON 03h. The start and end bits are 02h and 03h.
How can I convert 02h and 03h to its ascii form. In hyperterminal, I use the sequence {(hold)ALT 0 0 2} on the number pad to send the start bit.
I am using this code currently without the start and end bits
I have the following code Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim mesaj As New Integer
[Code]...
The timer interval is set to 5000(5 seconds), but every time when the timer is ticking the msgbox appears on screen but the in the file msg.txt is writting once. So, The timer check if that unic is different from unic1, and if is different shows up a msg box, and it's writting the new line in msg.txt, but on next timer tick, even if the unic and unic1 are equals the msgbox shows up anyway, but it's more interesting because it doesn't write again in file, only shows up the msgbox. I don't understand this.
Let's say I have the this statment If textbox1.text <> textbox2.text Then
Now I want the msgbox to show me both values at the same time. I know if I want it to show me the value of one of the textbox i just have to use & val(textbox1 or 2.text) &. How do I make it show me both of them at the same time.
I'm currently trying to create a program that includes a text box (to input a number into), a button and a list box that will display the times tables for the number that is entered into the text box.
The idea of the program is so that a user can enter a number into the text box, for example, the number 5 and all the times tables (up to 12) will be displayed[code]...
I have a problem about read in excel to textbox in VB,I want show time (format hh:mm:ss) of "A1"(is 16:50:20) in excel to textbox in VB but I get "10.720 " in text box
i know that VB.net and above don't use true transparency(and maybe true opacy) except forms, but even them have 1 visual bug. because if the we put the backcolor igual to transparent key, the picturebox is transparent... but give us a form hole.i found several codes that do transparency, but i see 1 problem on them, because the control needs time to be transparent.[code]some codes(that i founded on internet) are diferent but give us the same result.can anyone explain to me why the control needs so many time to show transparent?(i have tested using the keyboard to move the control, and i see the control is like visible and then hide and then visible. and if i continue click on key, the control isn't showed until i release the key)
im trying to let the datagrid show the selected time without scrolling.does anybody know how i can make the datagrid show all the selected time and automatically adjust.the selected rows to the datagr size
I have the code below which works fine, however, if a mandatory field is not populated it prompts a message box, what I want to do is display ONLY one message box and show all the messages at one go, instead of one at a time. Also, I want the cursor to be prompting to the next mandatory field to be inserted according to the list.
The maximum value that works for AutoPopDelay property of ToolTip is 30 seconds (30000 milliseconds). Any values greater than this maximum will be defaulted to 5 seconds (5000 milliseconds).[url]...
How to set to extend the duration show time for ToolTip? or alway show until the mouse leave the control?
i have a combobox that has 3 cases. case "0" opens a dialog saying, "Not a valid choice"but case "1" and case"2" open up there own separate forms. (FormMain and Form3)How do i make it so if Form3 is open FormMain Can not be opened, And a messagebox appear saying so. I do not just want the ".hide" function. I already have that set.I have tried a few differant things, none of which worked. And i tried them in the formload and in the combobox selected index
I have a date that I retrieve from database. I want to give ability to edit time on my gridview, as my date is date+time, I want to show the time on my database as my selected value on the dropdown list and a ability to choose other times from the list and save back again with date+time on the database.[code]
My Project having form-1 & form-2. Project starts with Form-1.From the form-1, button1 - click() I want to close the form1 and from2.showform2.show showing form2, but the form-1 is also still opened. How to close form-1?I tried from Form-1 as me.close(). then Form-2 is not showing.So how to close form-1 at the time of form2.show?
How I can use a messagebox to show for a specific amount of time only? So if I place this in maintimer, MessageBox will show and will auto close and I set how long it must display for. If messagebox is up, then Timer is paused. I did research around these lines but couldn't find what I'm looking for.