|
Hi,
Thanks for ur interest.
This is what I need exactly.
I have a Pc with internet connection (Dialup connection).
My friends and family members are using that Pc for browsing websites.
I'd like to log the everyone's total time of internet using.
This will help me to track who uses internet connection more.
For eg. consider this situation (Assume everyone has seperate windows user account)
1.Friend1 login to Windows.
2.He connected to the Internet using dialup connection at 6.00 P.M
3.He browsing web pages.
4.Friend1 disconnect the internet connection at 8.00 P.M
Our Windows service should record the foll. details.
==================
Date : 06/04/2004
User : Friend1
In : 6.00 P.M
Out : 8.00 P.M
==================
Could u understand my prob.
Can u suggest me the soln. for this ?
Thanks in advance.
|
|
|
|
|
I already suggested methods of doing this, but it's not as easy as you may think it is. The only way to surely track that a connection is alive is if it is a dial-up modem connection. Since this type of connection is temporary and is not alive the entire time the machine is up, you can watch for changes in the IP stack, like gateway changes, that will occur when the connection is made and dropped.
If your using a cable modem or some other permanent connection, then this method will not work since the machine is connected all the time. You would have to monitor the process list for the various web browsers and FTP clients (by name!) to see how long the person is online.
RageInTheMachine9532
|
|
|
|
|
Hi,
Thanks for ur informations.
Its v interesting.
Say, I am a new bee to VB.NET as well as Windows services.
Can u suggest me any resources reg. this.
Thanks
DHARMA.R
|
|
|
|
|
Writing a Windows Service and monitoring the processes list are not exactly newbee projects. But you can search Amazon and checkout the dozens of books on VB.NET for every level from beginner to advanced programmers and cookbooks.
RageInTheMachine9532
|
|
|
|
|
Hi Dave,
Thank u v muc for ur help.
I'll check it out.
Regards
DHARMA.R
|
|
|
|
|
I have a dataset where i display info in a data grib but i would like to show it in textboxes instead, any ideas?
i was thinking
dataset --> a class --> to the textbox
|
|
|
|
|
Are you working on a Windows Form or on a Web Form?
What about the following?
myTextBox.DataBindings.Add(New Binding("Text", myDataSet, "myDataTable.myColumn"))
|
|
|
|
|
|
i would like to click on the datagrid and display the work in textboxes...
so that dosent work for me
|
|
|
|
|
hi
Please help me how to get the target path of windows shortcut fiels in Visual Basic
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
hi
Following code will resolve the target path of a shortcut named notepad.lnk in c:\
Change the path accordingly to meet ur requirment.
Dim objFolder As Folder<br />
Dim objFolderItem As FolderItem<br />
Dim objShell As Shell<br />
<br />
Set objShell = New Shell<br />
Set objFolder = objShell.NameSpace("c:\")<br />
<br />
Set objFolderItem = objFolder.ParseName("notepad.lnk")<br />
<br />
If Not objFolderItem Is Nothing Then<br />
Dim objShellLink As ShellLinkObject<br />
<br />
Set objShellLink = objFolderItem.GetLink<br />
<br />
If Not objShellLink Is Nothing Then<br />
<br />
Debug.Print objShellLink.Path<br />
End If<br />
<br />
Set objShellLink = Nothing<br />
End If
rgds..mil10
|
|
|
|
|
Thnks BUddy for the code
but the problem is that this code is not working in VB 6
i think this is the code for VB.NET because in VB 6 FolderItem and Shell does not Exist
would you please help me in this matter
Thanks
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
hi
I just came back to my desk after Easter vacation. Sorry for the delay.
The code works fine with vb6. But I missed to tell u one thing.
You have to give reference to C:\WINNT\system32\shell32.dll . Give reference to this dll and try.
Rgds…mil10
|
|
|
|
|
HI
Thanks for the reply.
But sorry to bother you again and again
i have some problems related to the code i have added the link to Shell32.dll
so the problem of variables resolve but the function are not working properly
Like
like SET FOLDERITEM = objShell.ParseIFle("c:\") I think this is the function , si this function is not returning the proper directory
I dont know why
woould you please Help me
Thanks
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
hi
No chance for any mishap, it shud work. Just chk the export list of shell32 using object browser whether those methods are there in the specified class. I tested it on Win2k professional and works fine.
rgds..mil10
|
|
|
|
|
hi
Cool man Thanks Very much the code is working too much file but with a little change i dont know why but the change is
Dim objFolder As Folder2 in the deceleration section.
Because in the Intellisence list their two Folder options one is FOLDER and other is FOLDER2.
Folder2 option contains the procedure PARSENAME() .
Any way thanks very much for the Help
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
I am trying to put a header on each of my columns in my data grid. I am getting an error while trying to run it. It is telling me that
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
The error is on the first line in this part of the code.
What am I doing wrong? I have a total of 6 columns. Any suggestions.
dgPayrollInfo.GridColumnStyles(0).HeaderText = "Employee ID"
dgPayrollInfo.GridColumnStyles(0).Alignment = HorizontalAlignment.Center
dgPayrollInfo.GridColumnStyles(1).HeaderText = "Payroll ID"
dgPayrollInfo.GridColumnStyles(1).Alignment = HorizontalAlignment.Center
dgPayrollInfo.GridColumnStyles(2).HeaderText = "Pay Date"
dgPayrollInfo.GridColumnStyles(2).Alignment = HorizontalAlignment.Center
dgPayrollInfo.GridColumnStyles(3).HeaderText = "Gross Pay"
dgPayrollInfo.GridColumnStyles(3).Alignment = HorizontalAlignment.Right
dgPayrollInfo.GridColumnStyles(4).HeaderText = "Withholding"
dgPayrollInfo.GridColumnStyles(4).Alignment = HorizontalAlignment.Right
dgPayrollInfo.GridColumnStyles(5).HeaderText = "Net Pay"
dgPayrollInfo.GridColumnStyles(5).Alignment = HorizontalAlignment.Right
Thank you,
ibok23
|
|
|
|
|
I am trying to get the caption/title string of a hidden window, which is bascally a cmd.exe running in the background (not visible on screen). But using GetWindowText() function, I get an empty string back.
If I make that cmd.exe window visible, then it extracts the right caption of that window.
Any idea on what should I use if I have hidden process running in background to get its caption/title bar??
Many Thanks.
|
|
|
|
|
hi
If GetWindowText returns empty string then it means that the window does not exist at all. GetWindowText will return the exact caption even if the window is invisible. So if GetWindowText returns NULL then either the window does not exist or the window doesn't have a caption.
Use Spy++ ( comes with visual studio ) to inspect all active windows and processes.
rgds..mil10.
|
|
|
|
|
OK, I dont know but it doesn't work for me .
If you like, I can send you my code.
Anyways, any idea on how to get only hidden processes listed in VB?
Thanks.
|
|
|
|
|
Hi
I just back to my machine 2day morning ,after easter vacation.
Ok u send me the code. i shall try it out. to get all running process details try thr following.
Call TerminateProcess to terminate a process. This needs the process handle as input. Call OpenProcess to get the process handle. This needs processId as input. Call Process32First and Process32Next to loop thru the running process and to get the ProcessId. Call CreateToolhelp32Snapshot before calling Process32First .
sample code is available on msdn.
rgds..mil10
|
|
|
|
|
The following is the way to put the button and also add the functions for ConnectButton and DisconnectButton when those buttons are pressed.
however, whenever press one of button two functions will be executed instead of only the one with pressed but both of them. Why is that?
Dim WithEvents ConnectButton As CommandBarButton
Dim WithEvents DisconnectButton As CommandBarButton
' Connection Button
With ConnectButton
.Style = msoButtonIconAndCaption
.Caption = "Connect"
.FaceId = 19
.ToolTipText = "Press me for fun and profit."
'.OnAction = "ConnectButton"
.Tag = "My Big Button"
End With
'Disconnection Button
Set DisconnectButton = _
.Add(msoControlButton)
' Disconnect Button
With cbcDisconnectButton
.Style = msoButtonIconAndCaption
.Caption = "disconnect"
.FaceId = 19
.ToolTipText = "disconnect from iims"
'.OnAction = "DisconnectButton"
.Tag = "My Big Button"
End With
|
|
|
|
|
You're supplying the wrong code. What you should be looking at is the tail end of the Click handler functions for each button. Does they say something like this:
Private Sub ConnectButton_Click( ... ) Handles ConnectButton.Click, DisconnectButton.Click
What you problem is is two functions are handling the Click event for one button. Make sure that you don't see two event tags, or the wrong event tags at the end of the function declaration.
RageInTheMachine9532
|
|
|
|
|
>You're supplying the wrong code. What you should be looking at is the tail >end of the Click handler functions for each button. Does they say something >like this:
thanks i didn't have anything at the back of function name just
Private Sub ConectButton_Click()
{
..
}
so that's why, right. I only need to do is to put this handles statement
in order to get it work for each event.
Thanks for your help.
Shiny
|
|
|
|
|
With a ComboBox, I can write ComboBox1.DroppedDown = true.
How can I do the same with DateTimePicker?
Thank you,
Dino
Dino Buljubasic
|
|
|
|