|
Use this function
Public Function IsInternetAvailable() as Boolean<br />
Dim oUrl As New System.Uri("http://www.yoursite.com/") 'Change to web address you wish to check<br />
Dim oWebRequest As System.Net.WebRequest<br />
Dim oResponse as System.Net.Response<br />
<br />
Try<br />
oResponse = oWebRequest.GetResponse<br />
oResponse.Close()<br />
oWebRequest = Nothing<br />
Return True<br />
Catch ex as Exception<br />
oResponse.Close()<br />
Finally<br />
oResponse.Close()<br />
oWebResponse = Nothing<br />
End Try<br />
End Function
Call check your connection status with
If IsInternetAvailable() Then<br />
Messagebox.Show("you are online !!!")<br />
End If
Steve Jowett
|
|
|
|
|
Hi,
I'm open serialport (COM1) and send AT command.How am I receive respond from serialport like msgbox("OK command")?
Thanks!
|
|
|
|
|
This may be simple, but I am very new to VB.net(any programming come to that), so please bear with me, while I learn
I need to ensure that a user only enters a number into a text box and not words. I can convert the contents of the text box to an integer without a problem, but the problems start, for example if the user enters the word "Seven" as opposed to the number "7".
I only want pointing in the right(!) direction, not the code
Many thanks
-- modified at 8:27 Tuesday 6th June, 2006
|
|
|
|
|
If Not IsNumeric(e.KeyChar) Then<br />
MessageBox.Show("Write Only Numbers")<br />
e.Handled = True <br />
EndIf
|
|
|
|
|
if you have MSDN installed . just paste ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/E_System_Windows_Forms_Control_KeyPress.htm into the address bar of msdn library and look at the sample code of microsoft.
|
|
|
|
|
|
Read the docs on ADO.NET, or find an article on Database access with VB.NET, or search google.
This question has been asked so many times that a little searching will get you the answer in no time.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Sir,
I want to search the substring "this is" in the string "This is a search".
Please tell the function for the same.I am using Instr Function.The problem is if the string is "this a atring" and I search for "this is" even then I get the answer that the sustring is there.Please tell the appropriate function.
Thanks and Regards
Amaneet Brar
|
|
|
|
|
dim source as string = "This is a search"<br />
dim source2 as string = "This a atring"<br />
dim search as string = "This is"<br />
<br />
Console.WriteLine(source.IndexOf(search)) ' Prints "0" as the search exists at position 0<br />
Console.WriteLine(source2.IndexOf(search)) ' Prints "-1" as the search does not exist at all
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Dear All,
Please help me, give code on how to enumerate specific type of control in form?
Thanks
lin xen mung - Indonesia
|
|
|
|
|
foreach(Control control in myForm.Controls)
{
if(control is TextBox)
{
}
else if(control is ComboBox)
{
}
}
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
-- modified at 5:49 Tuesday 6th June, 2006 (fixed typo)
|
|
|
|
|
hi ,
please help me to get the api for hardware devices connected to system in vb6. To know the status of the scanner connected to USB.
thanks in advance,
bye.
|
|
|
|
|
Hello Friends
kindly see the code VB6 code given below
Private Declare Function concat Lib "d:\StringConcat1.dll" (ByVal Text1 As String, ByVal Text2 As String) As String
Private Sub Command1_Click()
Text3.Text = concat(Text1.Text, Text2.Text)
a = Len(concat(Text1.Text, Text2.Text))
MsgBox a
End Sub
The function of the vb code is given below. The form has three text fields
a) The first text field , enter the first string
b) The second text field , enter the second string
c) The third text field, concatation of the two string i.e result of the two strings is shown in third text field
When we call "StringConcat1.dll" dll the value entered through the two text fields is send as a argument by value to the dll and concatation of the strings is done in C++ .
the dll code is given below "test.cpp"
#include <string.h>
char* __stdcall concat(char *string1 , char *string2)
{
return strcat(string1,string2);
}
the def is given "test.def"
LIBRARY StringConcat1
EXPORTS
concat @1
When I debug the code , the Concatenation is done in C++ but when the result is given to vb code ie front only the first string that is entered in the first text is shown only as the output in the third text field.
Kindly note the point:
the C++ code works perfectly.
After computation ie Concatenation , the result is not shown in the vb code
Can any help me in this matter
From Phijo Philip
|
|
|
|
|
how can i create new theme form?
................
|
|
|
|
|
How to change title bar when javascript is alert?
................
|
|
|
|
|
Hello everyone,
Given the following HTML code on a webpage:
<td class="bdr_tl">
<input type="hidden" name="x_id" value="x1as">x1as</td>
<td class="bdr_t"><input type="text" name="x_val" value="" size="4" maxlength="4"></td>
<td class="bdr_tl">
<input type="hidden" name="x_id" value="x2a2">x2a2</td>
<td class="bdr_t"><input type="text" name="x_val" value="" size="4" maxlength="4"></td>
I want to search for each x_id (which has a unique "value") and then update the value of corresponding x_val field.
Any ideas?
|
|
|
|
|
could you explain more so we can hekp you
Tamimi - Code
|
|
|
|
|
Hello,
Sorry for not giving more info.
I have a AxWebBrowser component (wb) on the form. After clicking on a button, a specific web site is loaded in wb. On this page are various
<td class="bdr_tl">
<input type="hidden" name="x_id" value="x1as">x1as</td>
<td class="bdr_t"><input type="text" name="x_val" value="" size="4"
maxlength="4"></td>
<td class="bdr_tl">
<input type="hidden" name="x_id" value="x2a2">x2a2</td>
<td class="bdr_t"><input type="text" name="x_val" value="" size="4"
maxlength="4"></td>
entries. In my program is an array that stores a new value for each x_val field for each x_id field.
I would thus like to start at the first element in the array, search for the corresponding x_id field on the web page, and update the correct x_val field with the value in the array. This continues until the end of the array.
Some of the values in the array might not have corresponding x_id fields on the current web page.
I hope this helps
Best regards
-- modified at 4:54 Wednesday 7th June, 2006
PS I am using VB .NET 2003
|
|
|
|
|
hello friends,
i need a help!!
how to call DLL from a VB!
the DLL might be codeed in VC++!
plz give me any referece URL or detail with example
thanks in advance!
Rahul here
|
|
|
|
|
|
who can send me a Student Information Management System in vb 6.0 language ?
(use sql for the date base)
thx for advance!
初学者!Don't try it, just do it!
*Archibald*rever dragon!
|
|
|
|
|
Get real! No one is going to send you a complete system written for you in VB6.
What problems are you having with your implementation? If you let us know that we can help you out.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Probably anyone who has passed the course you're now doing. If you want to be lazy and pass your course while remaining unemployable, www.rentacoder.com is the place to do it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all,
i've been trying to use a module to declare my connection, which im gonna call later on my forms.
here's the code in my module:
Imports System.Data.OleDb
Module mod_con
Public con_db_ssr As OleDbConnection
Sub establish_con()
con_db_ssr = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\i1984\Automation\db_ssr.mdb;")
End Sub
End Module
--------------------------------------------------------------------------
here's the code on how iam calling it on my form(s):
con_db_ssr.Open()
--------------------------------------------------------------------------
and here's the error im gettin:
An unhandled exception of type 'System.NullReferenceException' occurred in esB_SSR.exe
Additional information: Object reference not set to an instance of an object.
can anyone help me on this?
tnx...
-::maximus::-
|
|
|
|
|
VB.net / sql
Consider a table having A - Z fields storing integer values. Therefore each record in this table will have A - Z fields. I need to find the maximum value for each record from the fields A - Z.
Can you plz help me with this.
With Best Regards,
Mayur
|
|
|
|