|
Thank you very much for you valuable question. Of course my intention is monitoring the value of the other user when they access to our share file.It is not relate to security, permission....
When you working with "Computer Management" under the share and session folder, the value alawys change based onthe. I need to control that value in vb6 or vb.net.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Roath Kanel wrote:
Of course my intention is monitoring the value of the other user when they access to our share file.It is not relate to security, permission....
When you working with "Computer Management" under the share and session folder, the value alawys change based onthe. I need to control that value in vb6 or vb.net.
Value? What value? "based onthe"? Based on what? There are no "value"'s there so I don't know what your talking about. Are you talking about restricting the number of users who can attach to the Share? Or are you talking about controlling the number of users opening a file under a Share?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, I’m sorry that I did not give you clear enough information. Let get back to Computer Management in windows xp or 2k. Under “System Tools” there will be a node call “Shares Folders”. Under the “Shares Folders” nodes there are 3 sub nodes call “Shares”, “Sessions” and “Open Files”. Look at the right pane after you click on the “Shares” node, there will be a column label “# Client Connections”. This column represent the value of the user that has connect to your computer to access the network resources. If you click on the “Sessions” folder there will be a column label “User” at the right pane. This column will list detail user information such as computer name, connected time…
So, instead of open computer management and trace an activities, I would like to write an application that could will notify me any time if there is a user connect or disconnect from my network resource, and also the name of the user or machine name that connect our computer. The code could be written in vb6 or vb.net
Thank you!
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
How to make a form displaying the time according to our system date and time? How to check whether the date has changed or not? Or how to check whether the time is on specified time, e.g. check whether the time is 10:00 a.m or not?
Thanks for yout time....
Learning .NET
|
|
|
|
|
mythinky wrote:
How to make a form displaying the time according to our system date and time?
Drop a TextBox or a Label control on the form:
TextBox1.Text = DateTime.Now().ToString()
mythinky wrote:
How to check whether the date has changed or not?
There is no event that fires when the System Date/Time changes. You have to keep track of the Date when your app starts, then once in a while, say every minute, check the current system Date against the stored version. If the current Date is lower than the one where your app started, then the date changed. If the current date is greater than the stored date, then you have to check to see if midnight rolled over from the last time you checked. If it has not rolled over midnight, then the date changed.
mythinky wrote:
how to check whether the time is on specified time, e.g. check whether the time is 10:00 a.m or not
This code will check to see if it is 10:00am on the current date on which it is run:
Dim currentTime As DateTime = DateTime.Now()
Dim checkTime As New DateTime(currentTime.Year, _
currentTime.Month, _
currentTime.Day, _
10, 0, 0)
If DateTime.Compare(currentTime, checkTime) = 0 Then
' The current time is 10:00am today...
Else
' The current time is NOT 10:00am today...
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello All,
I need to create a macro in excel that determines all the possible unique permutations of a set of numbers. It is simple in concept but in my opinion it is not simple to code. Basically I want to do the following, the user enters the various number in seperate cells for the set(maximum number entered would be twelve), then enter the the maximum numbers to use in a squence from the set, i.e. determine all the pairs (2 numbers) within a set of three numbers. The program will then calculate all the unique permutations in the rows below (placing each number within a seperate cell within that row). Unique meaning that if 1,3 will appear then 3,1 would not since 1 and 3 are already combined.
Here is a simple visual of what I would like to do for the number of pairs within a set of three numbers.
Squence number (Choose a number 1 to 12 for the grouping):
Row 1 Cell 1: 2
Set of Numbers (Maximum of 12 Numbers):
Row 2 Cell 1 : 1 Row 2 Cell 2 : 2 Row 2 Cell 3 : 3
Program output should be the following:
Row 4 Cell 1 : 1 Row 4 Cell 2 : 2
Row 5 Cell 1 : 1 Row 5 Cell 2 : 3
Row 6 Cell 1 : 2 Row 6 Cell 2 : 3
I hope that this makes sense, but if anything needs clarification, please let me know. I hope you all can help me out. Thanks in advance for your help with this.
John Breen
|
|
|
|
|
For an algorithm like that, you'll have better luck searchin the web for existing code. Try searching Google or Yahoo for "permutations source code" and you'll find a bunch of examples. Nothing in Excel specifically the way you want it so you'll have to adapt the code to what you want.
This[^] one looked pretty interesting.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
There is another really good resource for all microsoft products you might want to try.
Every year Microsoft names a group of people as MVP's, or Most Valuable Professionals, in a specific product line.
The link below covers all their products and includes links to 25 Excel MVP sites:
Microsoft MVP Sites
Still coaxing software out of the can after all these years...
|
|
|
|
|
I did this once a long time ago with VB6 and I just can’t seem to remember how to go about the whole thing.
What I would like to do is transfer the value of several RadioButton’s (False or True) to a *.txt file. Then, I would like to be able to re-open the application and have it read the *.txt file and set the RadioButton values to reflect what was previously entered.
… or is there a better way to save these values?
Thanks.
Brad
|
|
|
|
|
You should look at the PropertyBag object which was designed for percisely this.
hope this helps,
sivilian
|
|
|
|
|
Is it possible to execute a function IF a comment (cell comment) was inserted on a particular worksheet?
My application dynamically creates new worksheets, and data is constantly changed. I need to be able to call a function regardless of the worksheet after a user enters a cell comment.
-----
My initial idea was to try and figure out a way to programatically add code to the worksheet object as it is created.. Although I wasnt able to figure out how to do so. (Worksheet object, as in the code that handles the worksheet events)
If anyone can tell me how to "programatically" add code to the worksheet object, that would also help.
__________________
|
|
|
|
|
Well, after trying many things, I have finally come up with a solution to this problem. If anyone else is interested, or if anyone searches for this topic in the future, here is what i did to solve my problem.
The following code was inserted in the "ThisWorkbook" Excel object:
Code:
Dim PrevCommentCount As Integer
Dim CurrCommentCount As Integer
Dim CWSName As String
Dim PWSName As String
'Sh corresponds to current sheet
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
CWSName = Sh.Name
CurrCommentCount = Sh.Comments.Count
End Sub
'Sh corresponds to previous sheet
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
PWSName = Sh.Name
PrevCommentCount = Sh.Comments.Count
If PrevCommentCount <> CurrCommentCount And PWSName = CWSName Then
Call Utils.UpdateCommentForSheet(Sh.Name)
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Comments.Count <> CurrCommentCount Then
Call Utils.UpdateCommentForSheet(Sh.Name)
CurrCommentCount = Sh.Comments.Count
End If
End Sub Basically, what happens is. when you select a new worksheet, it will store the number of comments found in that worksheet.
Once a new range is selected, or a new worksheet is selected, it will check the number of comments in the worksheet again. If this number is not the same, then a comment was changed.
It probably isn't the most efficient way to do it, although it seems to be the only way if you ask me
If anyone has any other ways to do this let me know.
|
|
|
|
|
Hi Jon. Here's another approach.
Option Explicit
Dim m_changedComment_Cell As Range
Dim m_changedComment_Text As String
Private Sub Workbook_SheetSelectionChange(ByVal sh As Object, _
ByVal Target As Range)
'--when the selection is changed, see if a
'-- comment was added/deleted/modified
LookForChangedComment
End Sub
Private Sub LookForChangedComment()
On Error GoTo End_LookForChangedComment
Dim sMessage As String
If m_changedComment_Text <> m_changedComment_Cell.NoteText Then
'-- a comment has been changed; do something useful?
sMessage = "Changed Comment Occured" & vbCrLf & _
"Cell: " & m_changedComment_Cell.Address & vbCrLf & _
"Old Value: " & m_changedComment_Text & vbCrLf & _
"New value: " & m_changedComment_Cell.NoteText
MsgBox sMessage
End If
End_LookForChangedComment:
Set m_changedComment_Cell = ActiveCell
m_changedComment_Text = m_changedComment_Cell.NoteText
End Sub This code is executing in the SheetSelectionChange event. It would probably make sense to add it to others for completeness (like the save event, or the activate/deactivate events).
|
|
|
|
|
Ok, so i have a custom class i created for variables
<br />
Public Class ptbounds<br />
Public Left As Integer<br />
Public Right As Integer<br />
Public Top As Integer<br />
Public Bottom As Integer<br />
Public Width As Integer<br />
Public Height As Integer<br />
Public hoffset As Integer<br />
Public woffset As Integer<br />
End Class<br />
and i want to compare 2 variables of this type as being = or != (in vb terms of course, but the html tags interfere with proper notation).... how would i define the rules for that?
|
|
|
|
|
Currently, VB.NET doesn't support Operator Overloading (support for this will show up in VB.NET 2005!) So, you'll have to write a method into your class that takes an instance of itself as a parameter and returns a True or False value based on the result of the combined comparisons of all the properties involved:
Public Class PtBounds
Public Left As Integer
Public Right As Integer
Public Top As Integer
Public Bottom As Integer
Public Width As Integer
Public Height As Integer
Public hoffset As Integer
Public woffset As Integer
Public Function op_Compare(ByRef operand As PtBounds) As Boolean
Return (Me.Left = operand.Left) And _
(Me.Right = operand.Right) And _
(Me.Top = operand.Top) And _
(Me.Bottom = operand.Bottom) And _
(Me.Width = operand.Width) And _
(Me.Height = operand.Height) And _
(Me.hOffset = operand.hOffset) And _
(Me.wOffset = operand.wOffset)
End Function
End Class
<code>Me</code> refers to the current instance of the class, while <code>operand</code> refers to the instance that is passed to the method:
<pre> Dim myObject1 As New PtBounds
Dim myObject2 As New PtBounds
' Setup both objects with appropriate values...
If myObject1.op_Compare(myObject2) Then
' Both objects are equal!
Else
' The objects are not equal!
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would expand on that to say that it is better to implement the IComparable interface than to create your own method. That way, the code that uses it is more standard, and your class is more flexible.
|
|
|
|
|
Normally, I'd say "do that" too, but in his case, I think it was more important to get the idea of operator overloading acrossed then it was to bring up IComparable. In the future, when he wants to, say, sort items, we can take him through an IComparable implementation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
im trying to drag staff member names from lstAvailableStaff to lstCurrentJobStaff. For some or other reason it keeps on dragging the same name everytime.A speedy reply would be most appreciated.
Here is the code:
Public Class frmAssignStaff
Inherits System.Windows.Forms.Form
Dim selectedStaffMember As String
Private Sub lstAvailableStaff_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstAvailableStaff.MouseDown
selectedStaffMember = lstAvailableStaff.SelectedItem
lstAvailableStaff.DoDragDrop(selectedStaffMember, DragDropEffects.Copy Or DragDropEffects.Move)
End Sub
Private Sub lstCurrentJobStaff_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstCurrentJobStaff.DragDrop
Dim test As String
'''***Cant get e.data.....to change value!!!
test = e.Data.GetData(DataFormats.Text).ToString
lstCurrentJobStaff.Items.Add(test)
End Sub
Private Sub frmAssignStaff_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lstCurrentJobStaff.AllowDrop = True
End Sub
Private Sub lstCurrentJobStaff_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstCurrentJobStaff.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
btnRemove.Visible = True
End Sub
End Class
Plz help a poor student
|
|
|
|
|
im trying to drag staff member names from lstAvailableStaff to lstCurrentJobStaff. For some or other reason it keeps on dragging the same name everytime.A speedy reply would be most appreciated.
Here is the code:
Public Class frmAssignStaff
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents lstAvailableStaff As System.Windows.Forms.ListBox
Friend WithEvents grpAvailableStaff As System.Windows.Forms.GroupBox
Friend WithEvents grpCurrentJobStaff As System.Windows.Forms.GroupBox
Friend WithEvents lstCurrentJobStaff As System.Windows.Forms.ListBox
Friend WithEvents btnSave As System.Windows.Forms.Button
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents btnRemove As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.lstAvailableStaff = New System.Windows.Forms.ListBox
Me.grpAvailableStaff = New System.Windows.Forms.GroupBox
Me.grpCurrentJobStaff = New System.Windows.Forms.GroupBox
Me.lstCurrentJobStaff = New System.Windows.Forms.ListBox
Me.btnSave = New System.Windows.Forms.Button
Me.btnCancel = New System.Windows.Forms.Button
Me.btnAdd = New System.Windows.Forms.Button
Me.btnRemove = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.grpAvailableStaff.SuspendLayout()
Me.grpCurrentJobStaff.SuspendLayout()
Me.SuspendLayout()
'
'lstAvailableStaff
'
Me.lstAvailableStaff.Items.AddRange(New Object() {"Falicia", "Ferzhana", "Asheeqah", "Kathryn", "!!JonnoMan!!"})
Me.lstAvailableStaff.Location = New System.Drawing.Point(16, 24)
Me.lstAvailableStaff.Name = "lstAvailableStaff"
Me.lstAvailableStaff.Size = New System.Drawing.Size(264, 368)
Me.lstAvailableStaff.TabIndex = 0
'
'grpAvailableStaff
'
Me.grpAvailableStaff.Controls.Add(Me.lstAvailableStaff)
Me.grpAvailableStaff.Location = New System.Drawing.Point(8, 8)
Me.grpAvailableStaff.Name = "grpAvailableStaff"
Me.grpAvailableStaff.Size = New System.Drawing.Size(296, 400)
Me.grpAvailableStaff.TabIndex = 1
Me.grpAvailableStaff.TabStop = False
Me.grpAvailableStaff.Text = "Available Staff"
'
'grpCurrentJobStaff
'
Me.grpCurrentJobStaff.Controls.Add(Me.lstCurrentJobStaff)
Me.grpCurrentJobStaff.Location = New System.Drawing.Point(384, 8)
Me.grpCurrentJobStaff.Name = "grpCurrentJobStaff"
Me.grpCurrentJobStaff.Size = New System.Drawing.Size(288, 400)
Me.grpCurrentJobStaff.TabIndex = 2
Me.grpCurrentJobStaff.TabStop = False
Me.grpCurrentJobStaff.Text = "Current Job Staff"
'
'lstCurrentJobStaff
'
Me.lstCurrentJobStaff.AllowDrop = True
Me.lstCurrentJobStaff.Location = New System.Drawing.Point(16, 24)
Me.lstCurrentJobStaff.Name = "lstCurrentJobStaff"
Me.lstCurrentJobStaff.Size = New System.Drawing.Size(264, 368)
Me.lstCurrentJobStaff.TabIndex = 0
'
'btnSave
'
Me.btnSave.Location = New System.Drawing.Point(229, 424)
Me.btnSave.Name = "btnSave"
Me.btnSave.TabIndex = 3
Me.btnSave.Text = "&Save"
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(384, 424)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.TabIndex = 4
Me.btnCancel.Text = "&Cancel"
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(312, 176)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(64, 23)
Me.btnAdd.TabIndex = 5
Me.btnAdd.Text = ">>"
'
'btnRemove
'
Me.btnRemove.Location = New System.Drawing.Point(312, 216)
Me.btnRemove.Name = "btnRemove"
Me.btnRemove.Size = New System.Drawing.Size(64, 23)
Me.btnRemove.TabIndex = 6
Me.btnRemove.Text = "<<"
Me.btnRemove.Visible = False
'
'TextBox1
'
Me.TextBox1.AllowDrop = True
Me.TextBox1.Location = New System.Drawing.Point(104, 424)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 7
Me.TextBox1.Text = "TextBox1"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(16, 424)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 8
Me.Button1.Text = "Button1"
'
'frmAssignStaff
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(688, 470)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.btnRemove)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
Me.Controls.Add(Me.grpCurrentJobStaff)
Me.Controls.Add(Me.grpAvailableStaff)
Me.Name = "frmAssignStaff"
Me.Text = "frmAssignStaff"
Me.grpAvailableStaff.ResumeLayout(False)
Me.grpCurrentJobStaff.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Dim selectedStaffMember As String
Private Sub lstAvailableStaff_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstAvailableStaff.MouseDown
selectedStaffMember = lstAvailableStaff.SelectedItem
lstAvailableStaff.DoDragDrop(selectedStaffMember, DragDropEffects.Copy Or DragDropEffects.Move)
End Sub
Private Sub lstCurrentJobStaff_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstCurrentJobStaff.DragDrop
Dim test As String
'''***Cant get e.data.....to change value!!!
test = e.Data.GetData(DataFormats.Text).ToString
lstCurrentJobStaff.Items.Add(test)
End Sub
Private Sub frmAssignStaff_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lstCurrentJobStaff.AllowDrop = True
End Sub
Private Sub lstCurrentJobStaff_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles lstCurrentJobStaff.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
btnRemove.Visible = True
End Sub
End Class
Plz help a poor student
|
|
|
|
|
how can i interface my scanner with vb.net
saud
|
|
|
|
|
Your best bet is to see if the manufacturer of the scanner has an SDK available. WIth an SDK, you'll probably be able to use all the features of the scanner. Otherwise, you'll be using the Windows Image Acquisition API (First available in Windows XP.) But, you'll just get the basic scanning abilities. You won't get to use any specific features of your scanner.
The documentation on the WIA Automation Layer begins here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello all,
I have a little .NET vs. VS 6 user control curiosity! *^_^* any takers?
If I have a project that contains a user control that I made in VS6 and then want to convert it to VS.NET, can I still call the component / dll from within a test application that was created mainly in VB6? Does anyone have exerience with the conversion of user controls - because when the project with the user control is converted to .Net, the user control code is totally gone in the .Net version of the project!
Well a little insight would help me a long way!
Thanks guys,
Maria
Maria
|
|
|
|
|
Well, your best bet is to rewrite the project in VB.NET. You CAN use a VB.NET User Control in VB6. But since the Forms and Controls work VERY much differently between the two versions, you'll spend more time getting the new controls to work in the old VB6 than if you just rewrote both projects in VB.NET.
The Visual Basic 6 Upgrade Wizard in Visual Studio .NET 2003 will upgrade VB6 User Control projects, as well as Standard .EXE projects, but, as with all automated upgrades, you'll have to tweak, and possibly even re-write the code that the Wizard generates.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a max number of files a folder can have in Windows 2000? How many?
Is there a max size a folder can have in Windows 2000? How many?
What about other Windows versions?
1fm1fu
|
|
|
|
|
These values are not really dependant on Windows, rather they are limitations of the file system the drive was formatted with.
steff kamush wrote:
Is there a max number of files a folder can have in Windows 2000? How many?
If the drive is formatted NTFS, there is no limit. Under FAT12, FAT16 and FAT32, I think the limit for the root directory ONLY is 512 files.
steff kamush wrote:
Is there a max size a folder can have in Windows 2000? How many?
Under any file system, no there is no limit to the total size of the files in a folder.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|