|
Hi,
How to know that an internet connection is alive at some instant of time?
I know that there are methods like InternetGetConnectedState and InternetCheckConnection which tell that whether a internet connection is alive and whether a particualr url is reachable..
But I would know this when I run the application..
But How to write a simple application which dynamically knows that the internet connection has just been estabilished? Or a particular url is reachable now (just like hooking?)
|
|
|
|
|
To check something is reachable, you could attempt to ping it.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
I already know half the solution to this problem, as I told you that there are methods in 'wininet.dll' to know that internet connection is available, but I want to create an application which identifies the connection dynamically..
What I mean is that when the user plugs in his modem or anything like this which connects his system to internet, I want this application to write a log somewhere or maybe pop up a screen..
how do I do this?
|
|
|
|
|
You could always write an application that runs at Startup, and attempts the connection every second or so.
|
|
|
|
|
Did you mean to say I write a windows Service for that?
Well that would be very heavy performance wise..
Can you suggest something else please?
|
|
|
|
|
ptr2void wrote: Did you mean to say I write a windows Service for that?
Nope, as one of your requirements was for some form of UI. Just write your application to use a tray icon and have it run as part of the Startup process (i.e. if it's in the Startup directory in your start menu, it automatically gets started when the user logs in).
|
|
|
|
|
If I remember, there's a way to check if the internet connection is active through WMI. The failing of this method I remember was that you don't know if there's an internet connection but that the LAN connection is active. It is assumed that if the LAN is active there is an internet connection.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"You're an idiot." John Simmons, THE Outlaw programmer
"I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
|
|
|
|
|
Mustafa Ismail Mustafa wrote: It is assumed that if the LAN is active there is an internet connection.
Assumed by who? A LAN connection does not mean that LAN has access to the internet!
|
|
|
|
|
J4amieC wrote: A LAN connection does not mean that LAN has access to the internet!
I know that, what I meant is the solution's draw back was that it assumes that if there is an active LAN connection then there is Internet connectivity.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"You're an idiot." John Simmons, THE Outlaw programmer
"I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
|
|
|
|
|
Hi all..
How can set richtextbox transparent..?
Thank you..
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
|
|
|
|
|
|
hi
how to get list of all tables that exist in my sql server instance ?
i'm using this scrpit :
select * from sys.tables
but this command return only tables that exist in Current Database.
thanks
|
|
|
|
|
How about posting here? http://www.codeproject.com/script/Forums/View.aspx?fid=1725
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"You're an idiot." John Simmons, THE Outlaw programmer
"I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
|
|
|
|
|
check this
use databasename<br />
select * from information_schema.tables
or this
SELECT *<br />
FROM dbo.sysobjects
or for more information check this...[^]
I Love T-SQL
|
|
|
|
|
thanks for reply
this is statements is very useful for me :
select * from information_schema.columns
but this scrpit only get information from current database while i want for all databases in server.
|
|
|
|
|
Then iterate over each of the databases performing the same query.
|
|
|
|
|
yes, of course.
but how to iterate through each database ?
|
|
|
|
|
To identify all user defined tables on a particular instance, you would use select name from master.sys.databases where owner_sid != 0x01
|
|
|
|
|
select name from master.sys.databases where owner_sid != 0x01
this script only list 3 database name for me :
ReportServer
ReportServerTempDB
AdventureWorks
|
|
|
|
|
hdv212 wrote: this script only list 3 database name for me :
ReportServer
ReportServerTempDB
AdventureWorks
And? How am I supposed to know what databases you have? I did state that this was per database instance so, if you think you are missing some, you need to check to see that you are hitting the right instance. For instance, you may find that one instance is running as (local) and the other as (local)\SQLExpress.
|
|
|
|
|
enumerate list of databases by:
use master<br />
SELECT name<br />
FROM sysdatabases
I Love T-SQL
|
|
|
|
|
IF you are using SQL Server 2005 (it doesn't work on any other)
exec sp_MSForEachDB<br />
@command1 = "use ? select '?',name,type from sysobjects where type = 'U' "
and please post sql questions in the sql forum.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello guys,
I am struggling for 3 days now with the problem of reading and writing form/to an usb port. For this I tried to use LibUsbDotNet. The library has a very nice and at first I though useful documentation. My problem is that I cannot reference the UsbDevice object that I want to use.
I tried to iterate through the UsbDeviceList but have no success because the List is empty (I cannot understand why) . I tried with different sticks and card reader device and the result is the same the DeviceList is empty obviosly I doing something wrong but I cannot figure what .
<br />
UsbDeviceList usbDeviceList = new UsbDeviceList();<br />
IEnumerator<usbdevice> enumerator = usbDeviceList.GetEnumerator();<br />
while (enumerator.MoveNext())<br />
{<br />
usbDevice = enumerator.Current;<br />
if (usbDevice.Info.IdVendor == infoDevice.IdVendor)<br />
break;<br />
}<br />
</usbdevice>
LibUsbDotNew Library[^]
Hope some of you worked with this library and cam help me with some useful tips.
Thanks
|
|
|
|
|
Try this: http://www.icsharpcode.net/OpenSource/SharpUSBLib/default.aspx[^] but it will need this installed: http://libusb-win32.sourceforge.net/[^]
I've tried it in 2 previous projects and it works like a charm.
I haven't tried LibUsbDotNet so I can't help you with that one, sorry.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"You're an idiot." John Simmons, THE Outlaw programmer
"I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
|
|
|
|
|
First I did not wnat to use that library but seems that I have no other sollution.
The problem with that library is that I didn't find a decent documentation and that it isn't maintained anymore.
Also you need to install the LibUSBwin 32 first ...
If you have some documentation or if you know a link please send a reply
Thanks.
|
|
|
|