Sunday, March 02, 2008

Error Log Tech

This Error will create an Entry in the Event log record and it will send as Error Message to u r Email also.

step1 :
web.config:

step 2 :
amar.0925@gmail.com>amar.0925@gmail.com />

in Global.assx

<%@ Import Namespace ="System.Web.SessionState" %>
<%@ Import Namespace ="System.Diagnostics" %>
<%@ Import Namespace ="System.Web" %>
<%@ Import Namespace ="System.Net.Mail" %>

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
Dim Errordescription As String = Server.GetLastError.ToString
Dim EventLogName As String = "IOMVErrorInformation"
If (Not EventLog.SourceExists(EventLogName)) Then
EventLog.CreateEventSource(EventLogName, EventLogName)
End If
' Inserting into event log
Dim log As New EventLog
log.Source = EventLogName
log.WriteEntry(Errordescription, EventLogEntryType.Error)
Dim mailobj As New System.Net.Mail.MailMessage
Dim ErrorMessage = "The Error Description as follows:" & Server.GetLastError.ToString
Dim message As New MailMessage("ravi@xyz.com", "amar.0925@gmail.com", "IOMV - Error Infomration", ErrorMessage)
message.IsBodyHtml = True
Dim emailClient As New SmtpClient("smtp.xyz.com")
Dim SMTPUserInfo = New System.Net.NetworkCredential(ravi@xyz, "12345")
emailClient.UseDefaultCredentials = False
emailClient.Credentials = SMTPUserInfo
emailClient.Send(message)

Wednesday, January 02, 2008

Group 1, Group 2 2008 Notification

Group 1 notification is released today i.e 27th Dec 2007.appsc told that a total of 197 post to fill by this notification. The applications are available from 21th Jan 2008 and the last date to send the filled allication is 8th Feb 2008.
the details no of posts in each category as follows

post category No of positions
Deputy Superintendent of Police 46
Commercial Tax Office 34
Assistant Audit Officers 43



Group 2 notification is released on 28th Dec 2007.appsc told that a total of 1468 posts to be filled by this notification. The applications are available from 11th Feb 2008 and the last date to send the filled allication is 29th Feb 2008.

to get the application by post, Send a demad draft of Rs 60. drawn on the name of

Printer & Publisher,
Appsc udyoga samacharam,
Appsc office,
Prathiba bhavan,
Mj Road,
Nampally,
Hyderabad.- 500001

Civil Services Examination, 2008

Examination Notice No. 04/2008
Dated : 29-12-2007
Last Date : 28.01.2008
The number of vacancies to be filled on the results of the examination is expected to be approximately 671.
for full details please visit: upse


IMPORTANT


1. CANDIDATES TO ENSURE THEIR ELIGIBILITY FOR THE EXAMINATION:
The Candidates applying for the examination should ensure that they fulfill all eligibility condition for admission to examination. Their admission at all the stages of the examination will be purely provisional subject to satisfying the prescribed eligibility conditions

Mere issue of admission certificate to the candidate will not imply that his candidature has been finally cleared by the Commission.

Commission take up verification of eligibility conditions with reference to original documents only after the candidate has qualified for interview/Personality Test.

2. APPLICATION FORM :

Candidates must apply in the Common Application Form devised by the Commission for its examination, which can be purchased from the Designated Head Post Offices/Post Offices (specified in Appendix III of the notice) throughout the country against cash payment of Rs. 20/- (Rupees Twenty only). Each such form can be used only once and only for one examination.

In case of any difficulty in obtaining Application Forms from the designated HPOs/POs, the candidates should immediately contact the concerned post Master or UPSC's "FORMS SUPPLY MONITORING CELL" over Telephone No. 011-23389366/FAX No. 011-23387310.

Candidates are advised to read carefully the "Instructions for filling up the Application Form" given in Appendix-II of this notice.

3. LAST DATE FOR RECEIPT OF APPLICATIONS :

All applications must reach the "Secretary, Union Public Service Commission, Dholpur House, Shahjahan Road, New Delhi - 110069" either by hand or by Post/Speed Post or by Courier, on or before the 28th January, 2008.

However, in respect of candidates residing abroad or in certain remote localities specified in para 6 of this Notice the last date for receipt of application by Post/Speed Post only (not by Hand or by Courier) is 4th February, 2008

Monday, November 12, 2007

Writing to the Event Log

In ASP.NET, error can be handled programmatically by writing appropriate code in the page-level error event, for errors on an individual page or in the application-level error event for handling errors that may occur in any page of the application.

Therefore, code for writing in the Event Log should be written in either of the events, depending on the requirement of the application. To illustrate this example, I have written the code in the application-level event with the error mode set to "RemoteOnly" and the defaultRedirect attribute to error.htm. The application-level error event should be included in the global file global.asax within the same application folder.

The contents of the global file can be given as follows:

Writing Log Entry in the Event Log

Imports System.Web
Imports System.Web.SessionState
Imports System.Diagnostics

Public Class Global
Inherits System.Web.HttpApplication

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

Dim ErrorDescription As String = Server.GetLastError.ToString

'Creation of event log if it does not exist
Dim EventLogName As String = "ErrorSample"
If (Not EventLog.SourceExists(EventLogName)) Then
EventLog.CreateEventSource(EventLogName, EventLogName)
End If

' Inserting into event log
Dim Log As New EventLog()
Log.Source = EventLogName
Log.WriteEntry(ErrorDescription, EventLogEntryType.Error)

End Sub

End Class

Custom Error Pages and Sending Email to Admin

Imports System.Web
Imports System.Web.SessionState
Imports System.Web.Mail

Public Class Global
Inherits System.Web.HttpApplication

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

Dim mail As New MailMessage()
Dim ErrorMessage = "The error description is as follows : " &_
Server.GetLastError.ToString
mail.To = "administrator@domain.com"
mail.Subject = "Error in the Site"
mail.Priority = MailPriority.High
mail.BodyFormat = MailFormat.Text
mail.Body = ErrorMessage
SmtpMail.Send(mail)

End Sub

End Class