|
Hi Folks
I enabled audit logging on a particual folder. The transactions happening on that folder will be logged in Security event logger. I want to generate an excel report with the details (User name, File Opened/Deleted/Created, DataTime).
Thanks in Advance
Regards
Hari
|
|
|
|
|
So what's the question? You haven't asked anything, other than implied your looking for permission to do this, in that case permission granted!
What part of this are you having a problem with?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave
I need help in reading Security log in .Net and generate an Excel report.
Excel report will have following columns
File Name | Date&Time | Action Performed | User
e.g.
D:\Temp\1.doc | 20-12-2006 07:10:10 AM | Updated | Hari
Thanks in advance
Regards
Hari
|
|
|
|
|
The question still stands. What part of this are you having a problem with??
Is it reading event logs? Writing to a .CSV file? Interpreting the Security events?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
I am unable to Interpreting the Security events?
Can you help me in how to Interpreting the Security events? and generate a CSV file. That CSV file should contain the log entries of only Audit folders.
E.g. if i enable audit logging on a folder in my machine "D:\Temp", then i want a report which should contain the information abt the activities performed in that folder like Creation of file,Deletion of file,Renaming a File and updating a file/Folder.
Format of the CSV/Excel file should be as follows
File | User | Date & Time | Action
D:\Temp\1.txt| Hari | 27-12-2006 | Deleted
Thanks in advance
Reghards
Hari
|
|
|
|
|
Sir/Madam,
I am openning a form on the button click.Now the problem is before creating the object of the form to be opened i want to check the form is already opened or not.
Thanks and Regards
Pankaj
|
|
|
|
|
What are you using to trigger the creation of your second form? What are you using to show your form? Are you calling .Show() or are you calling .ShowDialog() ??
If you're using .Show , you'll have to keep track of the instance of the form that you created. When you go to attempt to create the second instance of that form, check the variable you're using to track the new form. If it's not Nothing, then you can create a new instance of the form.
The problem comes when the new form closes. You have to listen for the form's FormClosing event so you can track that the form is in the process of closing. You can use this opportunity to retrieve any data you need off of that form before it dies completely.
Public Class Form1
Private OpenForm As Form2
Private Sub Button1_Click(blah, blah) Handles Button1.Click
If OpenForm Is Nothing Then
OpenForm = New Form2
AddHandler OpenForm.FormClosing, AddressOf OpenForm_FormClosing
OpenForm.Show()
End If
End Sub
Private Sub OpenForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs)
RemoveHandler OpenForm.FormClosing, AddressOf OpenForm_FormClosing
'
' Get any data you need from the form here...
'
OpenForm = Nothing
End Sub
End Class
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
mind if i suggest some VB6 alternative - i've yet to master .net so i don't really know if this works, but...
in vb6 i would do this
If formWhatever.Visible = True Then
Msgbox "Form already visible!"
Else
formWhatever.Show
End If
|
|
|
|
|
That won't work in VB.NET because Forms work VERY differently than they did in VB6. In VB6, every form was already instantiated and visible from anywhere in your code. This is no longer the case in VB.NET since forms are actually classes and you have to instantiate them yourself.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sir/Madam
Thanks a lot .It is working very fine.
Thanks and regards
Pankaj(India)
|
|
|
|
|
Sir/Madam,
I am trying to make a program using crystal reports in vb.net 2005.
The format of the crystal reports will be displayed in three rows for the particular employee (First row will denote the login in time , Second row will denote the logout time , and the third row will denote the total hours worked.) all these details will come under the days of selected month.The crystal reports will contain columns from 1 to 30 or 1 to 29 or 1 to 28 according to the no of days in the selected month.
Like in first column named 1 (1 is the first day of the month will describe the log in details , log out details in the second row and total hours in the thirs row.)
If somebody may please send any link .I am in urgent need of the code.
Please help.
Thanks and Regards
Pankaj Garg
(India)
Urgent answers will be appreciated.
|
|
|
|
|
amaneet wrote: Urgent answers will be appreciated.
Don't say "urgent". It's just plain rude. Notice how no one replied for over a year. Urgent doesn't work well around here.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
How would I declare and array of structure so that it's visible in my class.
This is in my declaration section
Structure passenger
Public passName As String
Public passAdd As String
Public passPhone As String
Public SeatNum As String
End Structure
Public passengers(15) As passenger
When I try to access passengers(0).passName in a sub, I get an error that says "Object reference not set to an instance of an object."
So how do I declare it so that my whole class can see it?
Thanks
Tom Wright
tawright915@gmail.com
|
|
|
|
|
When you create an array of structures, they are all initalized to zero. That means that all the string references in the structure are null (Nohting in VB). If you try to use a string that doesn't exist, you get that error message.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Okay, I think I was trying to do
private mypassenger(15) as new passenger
in my declaration section. However I get a compile error that says you cannot use te new operator on an array.
BBBBUUUTTT now I see what I am doing wrong.
I'll try it out and see what happens.
Thanks
Tom
Tom Wright
tawright915@gmail.com
|
|
|
|
|
See this[^] thread for an explanation of what's going on.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: See this[^] thread for an explanation of what's going on.
I thought I saw the same kind of problem going on earlier
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
I have a form that is TransparencyKey is set to White and the background is set to white and it comes out transparent, but then I have 2 pictureboxes that have a transparent image(an image with a transparent background), but it takes the background of the form, instead of the desktop. And I do have the me.allowtransparency = true. Does anyone have an Idea as to how just get the image to show and just the image no background color? I would appreciate any suggestions. Thank You!
|
|
|
|
|
hi,
try to set picture's backcolor = transparent...
Thanks & Regards...
Amit
|
|
|
|
|
I have already have it set that way! But Thank You for you time.
|
|
|
|
|
Hi all,
I just bought a G15 Gaming Keyboard, and ofcourse, I already managed to get something on the LCD (with a .NET Wrapped ).
Anyway, I also found out how to intercept the calls from Media Keys, and now, I want to send some mouseclick to Playa!TraX (Media Player) to Start, Pause, Skip song etc.
But, these mouse clicks need ot be sended on a specific coord IN the Playatrax screen, like the play-button (actually a custom created button control) is on x: 200, y: 140.
Second, the Playa!TraX window is also hidden (it slides away under the taskbar, it's called docking).
Third, the current window may not lose focus or something, so switching to playa!trax, moving the mouse to the play-button and click, and then go back to your last window isn't an option! It has to go smooth and unnoticeable.
You don't have to write the full code for me, but an example on how to send the mouseclicks to a specific coord on a specific window would be much appreciated (like how to specify the coords, and how to send the mouseclick, SendMessage didn't worked for me :S)! I already asked this on MSDN Forums, but it looks like Bill Gates didn't know the answer.
Best Regards,
Lennard Fonteijn
Quote from MoHAA (EA-Games): "You mess with the best, you die like the rest!"
|
|
|
|
|
What does your connection string look like? Hopefully, you've done something like the last example on this[^] page.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave. Thanks for your reply. ok here's the thing. i hope i can explain whats going on. my connection string to best describe is what i see as a predefined one. my connection string comes from settings.settings file from what i've learnt. now even if i create a new connection string in code it doesnt help. please instruct me what the best approach is.
Thanks Davo.
|
|
|
|
|
vbbeg wrote: now even if i create a new connection string in code it doesnt help. please instruct me what the best approach is.
I already have.
If you're using the wizards to add your database objects, uhhhh, all I can say is "Don't!". Write your own database code. It's nearly impossible to support the wizard generated code because it's all over the place and impossible to find.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello everyone,
I'm working on an application using VB.Net and Access. The program will read a text file similar to this -->
IM,CRP-FURT-0044148,D,0,@PROD02;IMAGES\00\00;CRP-FURT-0044148.TIF;2
IM,CRP-FURT-0044149, ,0,@PROD02;IMAGES\00\00;CRP-FURT-0044149.TIF;2
IM,CRP-FURT-0044150, ,0,@PROD02;IMAGES\00\00;CRP-FURT-0044150.TIF;2
IM,CRP-FURT-0044151, ,0,@PROD02;IMAGES\00\00;CRP-FURT-0044151.TIF;2
.. and save it to access database, but I keep getting [ array out of bound error ] & [ object reference not set to an instance of an object ]
code for when click import:
conv1.ShowDialog()
If (Not conv1.convFilePath Is Nothing) Then
Me.theDbConnection = db1.createNewDb
flag1 = db1.importData(Me.theDbConnection, conv1.convFilePath)
End If
If flag1 Then
Try
Dim table1 As DataTable = imgs1.fillDataTable(Me.theDbConnection)
Me.dataGridImgs.DataSource = table1
Me.currentRec.Text = ("1\" & table1.Rows.Count) << objct reference not set error
Catch obj As ObjectDisposedException
MessageBox.Show(obj.Message)
End Try
End If
----------
Function for the text delimiter file
Private Function cnvtIpro(ByVal cnvtFile As String, ByVal outFile As String) As Boolean
Dim flag1 As Boolean = True
Try
Dim reader1 As New StreamReader(cnvtFile)
Dim writer1 As New StreamWriter(outFile)
Dim textArray3 As String() = reader1.ReadToEnd.Split(New Char() {ChrW(10)})
Dim num1 As Integer = textArray3.Length
reader1.Close()
Dim num2 As Integer = 0
Do While (num2 < num1)
Try
Dim textArray1 As String() = textArray3(num2).Trim.Split(New Char() {","c})
If (textArray1.Length > 1) And (textArray1(0).ToUpper Is "IM") Then
Dim textArray2 As String() = textArray1(4).Split(New Char() {";"c})
Dim text1 As String = Me.setOutLine(textArray1(1), Path.GetDirectoryName(cnvtFile), (textArray2(1) & "\" & textArray2(2)), textArray1(2), textArray2(0).TrimStart(New Char() {"@"c}), "0")
writer1.WriteLine(text1)
End If
Catch exception1 As Exception
Dim result1 As DialogResult = MessageBox.Show((textArray3(num2) & " :INVALID"), exception1.Message, MessageBoxButtons.OKCancel, MessageBoxIcon.Hand)
If (result1 = Windows.Forms.DialogResult.Cancel) Then
flag1 = False
Exit Do
End If
End Try
num2 += 1
Loop
writer1.Close()
Catch exception2 As Exception
MessageBox.Show(exception2.Message)
flag1 = False
End Try
Return flag1
End Function
-------
Public Function importData(ByVal dbConnection As OleDbConnection, ByVal importFile As String) As Boolean
Dim flag1 As Boolean = True
Dim text1 As String = Nothing
Dim textArray2 As String() = Nothing
Try
dbConnection.Open()
Dim reader1 As StreamReader = File.OpenText(importFile)
Dim textArray1 As String() = reader1.ReadToEnd.Split(New Char() {ChrW(10)})
Dim num1 As Integer = textArray1.Length
reader1.Close()
Dim num2 As Integer = 0
Do While (num2 < num1)
Try
text1 = textArray1(num2).Trim
If (Not text1 Is "") Then
textArray2 = text1.Split(New Char() {ChrW(1)})
textArray2(1) = textArray2(1).Replace("'", "''")
textArray2(2) = textArray2(2).Replace("'", "''")
Dim stringConCat() As String = {textArray2(0), textArray2(1), textArray2(2), textArray2(3), textArray2(4), textArray2(5)}
Me.theOleDbCommand = New OleDbCommand(String.Concat(New String() {"INSERT INTO tblImages(Bates,FullPath,TiffName,PageBreak,Volume,ImgFrame)VALUES('" & textArray2(0), "','", textArray2(1), "','", textArray2(2), "','", textArray2(3), "','", textArray2(4), "','", textArray2(5), "')"}), dbConnection)
theOleDbCommand.ExecuteNonQuery()
End If
Catch exception1 As OleDbException
Dim text2 As String = ""
If (exception1.ErrorCode = -2147467259) Then
text2 = (textArray2(0) & ": already exists, duplicate bates not allowed")
Else
text2 = exception1.Message
End If
Dim result1 As DialogResult = MessageBox.Show(text2, "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand)
If (result1 = DialogResult.Cancel) Then
flag1 = False
GoTo Label_01A9
End If
End Try
num2 += 1
Loop
Catch exception2 As Exception
MessageBox.Show(exception2.Message)
End Try
Label_01A9:
dbConnection.Close()
Return flag1
End Function
Thanks you for helping out!
|
|
|
|
|