|
Ok, maybe I am dumb here but I am trying to detect if my computer is connected to the network.
I spend about 15 minutes going through the docs and I find the System.Windows.Forms.SystemInformation class with Network property. Seems all too easy...
I do the following:
<br />
Dim NetInfo As System.Windows.Forms.SystemInformation<br />
<br />
If NetInfo.Network = True Then<br />
pnlIndicator.BackColor = Color.Green<br />
<br />
Else<br />
pnlIndicator.BackColor = Color.Red<br />
<br />
End If<br />
...and I figure, heay great, I should get a green panel when I have my net cable plugged in and it should go read when my cable gets unplugged (I placed this code into a timer tic event hander).
NOPE. Does not seem to do anything...
Anyone have any darn ideas?
|
|
|
|
|
Mine seems to come up with "true" regardless of the reality as well.
Maybe it means "if there's a network card" or "if there's something plugged into the network card, regardless of where it might go"?
By the way, this function is static, you could just use:
<br />
' Dim removed<br />
If SystemInformation.Network Then<br />
pnlIndicator.BackColor = Color.Green<br />
Else<br />
pnlIndicator.BackColor = Color.Red<br />
End If<br />
Won't solve your problem though.
Paul
|
|
|
|
|
Yeah, looks like it just says 'why yes, you do have a nic'
|
|
|
|
|
Just reply "Well duh, I fitted it, you think I don't know it's there? Now is it connected to anything???"
;)
|
|
|
|
|
Actually, what it means is that you have "Networking" installed. Whether it's DHCP, NetBios, etc it will still show true. If you uninstall your Networking protocols, it should return false. I forget where I saw it but there is a way to detect the Network.
|
|
|
|
|
Well I have to edit an exsisting program that was written in vb6. One of the things that I am doing is adding mysql support to the program, which is in vb. There is no vb api for mysql so I had to write some dlls in c++ to handle mysql for the program. My problem now is that the program cannot find the dlls. Although they are in the same folder, and im sure I am calling them properly. Here is how im calling a function from one of my dlls in vb:
Declare Function writeInfo Lib "RideMySql.dll" (ByRef Param1 As String, ByVal Param2 As Integer, ByVal Param3 As Double, ByVal Param4 As Double, ByRef Param5 As String) As Integer
The corresponding funcion in c++ is prototyped as:
int __declspec(dllexport) CALLBACK writeInfo(char* param1, int param2, double param3, double param4, char* param5);
Thanks in advance.
|
|
|
|
|
Have you included a .def file within the C++ project? This allows VB to talk to the C++ .dll.
Nick Parker
|
|
|
|
|
I can not find anything. Can you send me a code for that please...
ICQ#3953196
rockettr@hotmail.com
_RoCKeT_
|
|
|
|
|
anyone know how to write a messenger WITHOUT using the msn network in .net, maybe with the windows sockets?
thanks!
|
|
|
|
|
Hi
I am also trying to build a messenger in VB.NET. Yes its possible using Winsock. But i am somehow unable to incorporate winsock API in my vb.net application.
|
|
|
|
|
Hi there!
I am learning VB.net, and want to develop my own text editor for program code.
How would I colour certain key words only??
If someone could point me in the right direction I would be most grateful!
Many thanks in advance,
Dan Fowler
|
|
|
|
|
You could easily catch evt the KeyUp event and see if theres somthing typed in that should be colorised..the keywords you could have in an array or something.. simply look up if theres is a match in the array, and then set the color.
Hmm...
|
|
|
|
|
You also need to be able to manage things like cut/copy/paste and the crazy way the poeple can edit (moving cursor around).
All in all it is not really easy, and an clear, fast, easy methid is not trivial.
|
|
|
|
|
If can use its together.I have a question.How to coding for AxCRViewer call report page?
|
|
|
|
|
What's the function to get the local computer name in VB6?
Have a good one!
|
|
|
|
|
There is none, but you can import GetComputerName from the windows API
|
|
|
|
|
You will need this in a module:
Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Then in your code:
Dim compname As String, retval As Long
compname = Space(255)
retval = GetComputerName(compname, 255)
compname = Left(compname, InStr(compname, vbNullChar) - 1)
HTH
Nick Parker
|
|
|
|
|
I have a code which is less complex
you will have to import import system.net.dns
Sample code is as follows:
Imports System.Net.Dns
Dim shostname As String
shostname = system.Net.DNS.GetHostName()
console.writeline("Your Machine Name = " & shostname)
hope that helps
|
|
|
|
|
This is not possible i VB6..
Hmm...
|
|
|
|
|
ohh you are right thats possible in VB.NET
|
|
|
|
|
Nick parker's code works perfectly!
Thank you all!
/Rulle
|
|
|
|
|
No Problem, you should consider becoming a member.
Nick Parker
|
|
|
|
|
I have a data entry entry screen. Here users are entering Checks details in batches. Each batch is having about 200 checks. User wants to save each row after finishing the row.
I did by using XMLDom. Which is calling another page? It is perfectly submitting the values to the database?
But it is slow and putting lot of load on the front end and increasing heavy network traffic in a 50 people environment.
Is there any better way to Insert, Update, delete the rows.
I am using asp, Oracle with IE 6.0
|
|
|
|
|
By saying Front end , do you mean that browser? If so, make sure that the asp page doing database update is returning only S(uccess)/F(ailure) message and then updating the DOM? If that is the case, it shouldn't put any load on front end because the page does not get refreshed.
Web-server load (so with N/W load unless it demands upgrade) is ok for 50 users because 50 users can not be 50 concurrent connections, in web environment.
cheers
vasu
|
|
|
|
|
Greetings all!
I am new to programming .NET and, to be perfectly honest, I'm not really an experienced programmer. I'm an engineer that is going to have to be doing some development. So, I'm looking for the best resources available for learning/developing in .NET. Where do you go for on-line information, add-ons... those things that make development time easier? I've been hearing about "communities". Do you really use those and are they valuable, or do you spend more time in discussion forums like this? What are the best forums?
Any information would be valuable. I appreciate your time!
Jerry
|
|
|
|