Format:
Recent snippets matching tags of log
<system.diagnostics> <sources> <source name="TraceSourceApp" switchName="sourceSwitch" switchType="System.Diagnostics.SourceSwitch"> <listeners> <add name="console" type="System.Diagnostics.ConsoleTraceListener"> <filter type="System.Diagnostics.EventTypeFilter" initializeData="Warning"/>
36 Views
no comments
private static TraceSource mySource = new TraceSource("TraceSourceApp"); static void Main(string[] args) { mySource.TraceEvent(TraceEventType.Error, 1, "Error message."); // Change the event type for which tracing occurs. // The console trace listener must be specified // in the configuration file. First, save the original // settings from the configuration file.
51 Views
no comments
//using System.Web.Security
FormsAuthentication.SignOut();
89 Views
no comments
//using System.Web.Security if (Membership.ValidateUser(username, password)) { //Log in user. FormsAuthentication.SetAuthCookie(username, true); } else { //Handle user not exist code.
90 Views
no comments
using System; using System.Diagnostics; using System.Windows; using System.Windows.Media; public partial class MyWPFClass : Window { public MyWPFClass() { InitializeComponent(); PrintLogicalTree(0, this);
155 Views
no comments
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="ViewLog.aspx.cs" Inherits="Module_Admin_ViewLog" ValidateRequest="false" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentHeader" Runat="Server"> <style type="text/css"> .lastUpdate { height: .8em; font-size: .8em; }
183 Views
no comments
#region REST_api [System.Web.Services.WebMethod] public static IList<string> GetLogTail(string logname, string numrows) { int lineCnt = 1; List<string> lines = new List<string>(); int maxLines; if (!int.TryParse(numrows, out maxLines))
94 Views
no comments
layout="${longdate} ${logger} ${level} ${message} ${exception:format=Type,Message,StackTrace:separator=[br]}"
314 Views
no comments
public MainWindow()
{
InitializeGeneralErrorHandling();
InitializeComponent();
}
private void InitializeGeneralErrorHandling()
126 Views
no comments
private static readonly log4net.ILog _logger = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod() .DeclaringType);
183 Views
no comments
<p><a href="http://www.freeflashtoys.com/?stick-figure-family"><img src="<br /> <b>Warning</b>: file_put_contents(/var/www/vhosts/pyzamstuff.com/httpdocs/family_images/d/da/8dbdc68a682a222c4305719ff611ef.png) [<a href='function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: No space left on device in <b>/usr/local/home/vhosts/pyzamstuff.com/httpdocs/savefamily.php</b> on line <b>19</b><br /> http://www.pyzamstuff.com/family_images/d/da/8dbdc68a682a222c4305719ff611ef.png" border="0" alt="Stick Figure Family at FreeFlashToys.com" /></a><br/> Make your <a href="http://www.freeflashtoys.com/?stick-figure-family">Stick Figure Family</a> at <a href="http://www.freeflashtoys.com">FreeFlashToys.com</a><img style="visibility:hidden;width:0px;height:0px;" border="0" width="0" height="0" src="http://stuff.pyzam.com/misc/CXNID=1000015.10NXC.gif" /></p>
116 Views
1 comments
public class SqlAppender : AppenderSkeleton { private static readonly string CommandText = "INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)"; public string ConnectionString { get; set; } protected override void Append(LoggingEvent loggingEvent) { using (var conn = new SqlConnection(ConnectionString)) using (var cmd = new SqlCommand(CommandText, conn))
270 Views
no comments
/// <summary> /// Summary description for CustomCatalogZone /// </summary> public class CustomCatalogZone : CatalogZone { // Fields private ITemplate _zoneTemplate; protected override CatalogPartChrome CreateCatalogPartChrome () {
149 Views
no comments
/// <summary> /// A replacement for the declarative catalog part meant for limiting the webparts on a page to a single instance by hiding the webparts that already exist on the page. /// </summary> [Designer ( "System.Web.UI.Design.WebControls.WebParts.DeclarativeCatalogPartDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" ), AspNetHostingPermission ( SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal ), AspNetHostingPermission ( SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal )] public class CustomCatalog : CatalogPart { // Fields private WebPartDescriptionCollection _descriptions; private string _webPartsListUserControlPath; private ITemplate _webPartsTemplate;
362 Views
no comments
[system.diagnostics.eventlog]::Delete("MyCustomLog")
202 Views
no comments
try { SaveFileDialog saveDialog = new SaveFileDialog { Filter = "Xml Files (*.xml)|*.xml", DefaultExt = ".xml", }; if ((bool)saveDialog.ShowDialog()) { using (Stream fileStream = saveDialog.OpenFile()) { ... }
658 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
