Writing To Event Log With My.Application.Log.WriteException
Aug 4, 2009
I'm handling the Application.UnhandledException event in a WinForms app and need to log exceptions caught there. My app.config is set up to log exceptions to a FileLog and an EventLog.The problem is that when running as a non-admin user, the EventLog cannot be written to because of a SecurityException - I get the message "The source was not found, but some or all event logs could not be searched."I understand why - the user does not have permission to create the EventLog source, but the question is how should this source be created? As I see it, I could either:
1) Create the EventLog source with my installer, as this is running as admin. How to do this?
2) Create from within my app, by somehow elevating permissions? But this would give the UAC prompt on Vista.
What's the best practice for creating a Windows Application EventLog source on a client machine?
View 1 Replies
ADVERTISEMENT
Jul 5, 2011
what is the different writing code application vbnet 2005 application for single user and multiuser?
View 3 Replies
Feb 13, 2010
I have an image of the political map of the USA. I want to write separate click events for each of the 50 states in Visual Studio. How would I do that?
View 2 Replies
Nov 24, 2009
I get the following error when I run my program on Windows 7 (x64) : The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security This is thrown on the following line:
[Code]...
View 9 Replies
Oct 12, 2009
I am learning visual basic. I have created a form for a calculator. I have placed buttons for plus, minus, division, multiply etc. The programme is working for clicing on buttons i.e. when I want to add two nos. I accept 1st no. from text box then I click on "PLUS" button then I accept 2nd no. When I click on "Equal" button the result is displaying on textbox. But I want to write code insted of clicking on "PLUS" button if press " + " key on keyboard and for "Equal" button, if I press " Enter " key on keyboard, The result for adding two number should display on textbox. I want code for both click event and keypress event.
View 2 Replies
Nov 27, 2010
I'm trying to complete this airline reservation application, but having a problem in this part of the question:Creat an event handler for the FlightBindingSource's PositionChanged event: select FlightBindingSource in the class Name combobox then select position changed in method name combobox to creat the FlightBindingSource's PositionChanged event handler. Write a code to access the currently displayed flight object and pass its flightNumber to method DisplayPassengers as a decimal.This Is my code so far:
HTML
Public Class AirlineReservationForm
Private database As New ReservationsDataClassesDataContext()
Private Sub FillAll()[code].....
View 13 Replies
Aug 19, 2009
is this a good idea or not really? instead of having to open a file through filestream, i would like to just save text in an encrypted format in application settings. is this OK if the text is under 10mb? what would be the best way of implementing this?
View 2 Replies
Jun 6, 2012
Am writing a GPS application but I need APIs or Libraries I can easily use. It's supposed to work real time...
View 5 Replies
Apr 30, 2009
i am writing a exit button for my application i am using the code :
MessageBox.Show(
" Exiting Application . ", " Application Closing ", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
How can i make it as such when i click "no" & "Cancel" it will not exit the application and only on yes it will exit ?
View 1 Replies
Mar 3, 2010
This windows application finds the amount of your pay if your pay is doubled each day, starting with a penny a day or a nickel a day. Instead of one month's salary, a boss offers her new employees a penny the first day and experienced employees a nickel the first day under a new pay system. Each day the pay will double.Restriction: The minimum number of days for the pay period is 19 days for the new employees and 16 days for the experienced.
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim intNumberOfDays As Integer[code].....
View 7 Replies
Mar 24, 2012
How can you write a VB.NET Windows Forms Application via CodeDom? I have tried everything, the closest i got to it is the code below, which first of all shows command prompt window which is not good, and then shows the form for like a second and everything disappears.
[Code]...
View 3 Replies
Mar 12, 2012
I'd like to create a simple application to determine the writing speed. In this application I want to view a line of text (may be more than one line) to the user to write it. And I want to select (higlight) the character the user pressed in my line and to move like a cursor to the next character (or to put underline under the current charater). How can I do that? and what is the object or component i must use to insert the text. Finally, if I want to make it multiple lines how to determine the enter key pressed by the user and how to move the cursor to the next line?
View 2 Replies
Jun 29, 2009
I found some code online for a vb paint application and I modified it for my use, which is a signature application. It uses a tablet connected to the pc to write the signature on the screen and then save it as a bitmap for later retrieval.The only issue i am having right now is that if you write on the tablet too fast, the signature gets broken up alot, any way to quicken the paint process in the code so that I can get a smoother signature?
Here is my code:
Imports System
Imports System.Collections
Imports System.Data
Imports System.IO
Imports System.Xml.Serialization
[Code] .....
View 1 Replies
Jun 28, 2010
I'm writing a small application that downloads some files over ftp, the incoming directory is monitored by FileSystemWatcher_Created, on creation I want to extract some text from the file and call another application with the text as parameters the problem I have is the FileSystemWatcher_Created procedure is triggered before the file has finished downloading, I could download it elsewhere and move into the monitored directory but some of the files may be quite large and Im wondering if there is an efficient way of waiting until the file is ready? along the same lines what is the best way to queue the tasks as there can be many files coming it at one time, I've looked at threading but would that be suitable for such a task as there will still be a bottleneck at the application called by FileSystemWatcher_Created ?
heres an outline of what im doing:
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
'read text file
[code]....
View 1 Replies
Jun 23, 2012
I am writing an application that has a user enter a wage per hour plus an anticipated salary increase percent and calculates the the users salary for the next 10 years. I have received some help from a few folks who are beginners like myself with visual basic and we are at a road block.
Public Class Form1
[code]...
Error1Expression is not an array or a method, and cannot have an argument list
View 3 Replies
Nov 5, 2010
I have written a VB.NET (2005) service that is using My.Application.Log to write log entries to a FileLogTraceListener. I have configured the Listener in app.config to write the log file to the executable file's directory by using
location="ExecutableDirectory"
When the service runs, it writes log entries just fine, but they are not in the executable file's folder, but rather in Documents and SettingsLocalServiceApplicationData....1.0.0.0mylog.log
Why is the location parameter not being honored?
Here is the complete system.diagnostics section from my app.config.
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="SplintService" switchName="DefaultSwitch">
[Code].....
View 2 Replies
Jan 18, 2011
What I am trying to do is I have a .dat file that I cannot read but can at the same time. What I mean is I know how to decipher it by hand (alas takes minutes per 6 parts and there are thousands.) I am trying to make an application that can read this and allow me to edit it from my computer. I can open this with a hex program such as hex editor neo. I am currently trying to get it so I can read the file and have it place corresponding parts in to text boxes that I can alter to suit my needs.
I am new to visual basic and know a tiny bit about C++ if you think I would be better off trying in C# I can try that as well I do know some since learning c++. There are 41 parts to each item listed in the file and each one would need to go in its own text box. In hex there are 348 blocks that need to be arranged in corresponding order. Also the beginning of the file has 6 block followed by a code for each item. I need to find a way to put all the correct code in the correct text box and have it make sense.
View 7 Replies
Jul 4, 2011
I am having a windows application. That downloads files from server and write into the local directory. It works fine. When we try the same appliication in Windows 7. IT shows an error Access to the path denied (While writing to the local directory).
View 1 Replies
Apr 13, 2012
I'm writing an application where when you click the "load database" button, it opens up a dialogbox where you have to go and open the database.txt which has a bunch of questions/answers.I want to make it so that after the user does that, the button disappears. But I can't get it to work at all. Here's what I have:
[code]...
Also, if I hit "cancel" then the whole program freaks out. What am I doing wrong?
View 1 Replies
Nov 7, 2009
Is it possible to capture a keypress with my application, even if the application isn't focused?And if it is, could someone please point me in the right direction? (I.E things to look up, tutorials)
View 2 Replies
Jan 21, 2009
What is a event driven application.
View 2 Replies
Mar 27, 2012
I have a single windows form application that is running in system tray icon.If the user press X button of the windows form a messagebox is displayed with Yes and No ( Yes ->close the form---No->keep the form running in system tray icon).I was thinking to prevent the scenario when the user open another instance of the application when there is already an instance running so i have used this code :
If Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length> 1 Then
MessageBox.Show("Another instance is running", "Error Window", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation)
Application.Exit()
End If
The problem is that when i want to test this the message is displayed but after i press ok, a new messagebox appears (that one from Private Sub Form_FormClosing ).If i choose NO i will have to instance running!I have read that Application.Exit fires the Form_FormClosing event.Is there any possibility to cancel the triggering of the Form_FormClosing event?'this is the formclosing
procedure
Private Sub Form_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Try
Dim response As MsgBoxResult
response = MsgBox("Are you sure you want to exit", CType(MsgBoxStyle.Question + MsgBoxStyle.YesNo, MsgBoxStyle), "Confirm")
[code]....
View 2 Replies
Mar 11, 2009
how to capture keypress event outside an application
View 1 Replies
Jun 6, 2011
I am developing a program where I will save the information from a "Log file" from an external application..I have a biometrics system that reads and saves the log file to disk,once the user logs to the system, the system will save the file to a log file after that the system that i will develop will read the data from the "log file"(probably a text file) and send it to sql server.
View 3 Replies
Oct 21, 2009
I am developing a program where I will save the information from a "Log file" from an external application..example: I have a biometrics system that reads and saves the log file to disk,once the user logs to the system, the system will save the file to a log file after that the system that i will develop will read the data from the "log file"(probably a text file) and send it to sql server what event should I use?
View 2 Replies
Mar 22, 2010
I recently created an event in event viewer to allow my VB.NET application to run when I start my PC up. Unfortunately, I don't remember how I did it and the thread I got the advice from has been deleted. Can someone explain to me how I could locate the event and delete it? As I don't want it to run on startup anymore.
View 11 Replies
Jun 1, 2011
How do you read a key down event when your application is not focus but other are?
View 2 Replies
Sep 1, 2009
I want to make it so that no matter which control has focus, it will do my event. So that I dont have to write a keydown event for all 137 of my objects. Is this possible?
View 2 Replies
Jul 9, 2009
I have an Application with 2 forms
Form 1 = FrmWindow this is an MdiParent Form
Form 2 = FrmInput this is an MdiChild Form
On Form 1 I have a Menu that's says New Input the onclick event looks as follows.
Code:
Dim ChildForm As Form
ChildForm = My.Forms.FrmInput
ChildForm.MdiParent = Me
ChildForm.Show()
This works and opens the FrmInput as a child of FrmWindow. On the form FrmInput I have two Textbox Controls and 2 Button Controls.
Textbox 1 = TxtName
Textbox 2 = TxtEmail
Button 1 = BtnSave
Button 2 = BtnExit
On the On Click event of BtnSave I have
Code:
SaveInformation()
The Public Sub for SaveInformation Looks like this.
[Code] .....
So when you click the save button it inserts a new record into the table TblInformation on my SQL database, everything works great. Now my problem is I want to be able to open multiple instances of the form FrmInput at the same time. So I changed the New Input button to the following:
Code:
Dim ChildForm As Form
Dim ChildInstance As New FrmInput
ChildForm = ChildInstance
ChildForm.MdiParent = Me
ChildForm.Show()
This works and I can now open up mutiple instances of the form FrmInput, what I cant figure out is how to save the information on a particular instance.
View 3 Replies
Aug 20, 2009
I've tired to use KeyPress event while in focus of my program's window in VB.Net, but it doesn't work.
For example I wanted to press the number "2" anywhere while in focus of the application and as effect the pixels of the window will change from 200,200 to 600,600 (hortizontal and vertical)
Private Sub Form1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
Form1_KeyPress(Keys.D2)
Dim size As Size
size = Me.Size
[Code]...
View 4 Replies