Exception.getLine C# (CSharp) Method

getLine() public method

public getLine ( ) : int
return int
    public virtual int getLine()
    {
        throw new NotImplementedException();
    }

Usage Example

コード例 #1
0
        /// <summary>
        /// Lưu lại thông tin lỗi vào tập tin error.txt; description: ghi chú đi kèm theo lỗi
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="description"></param>
        /// <returns>Trả lại thông báo lỗi</returns>
        public static string saveMessage(this Exception ex, string description = "")
        {
            ex.getLine().saveError(description);
            var serverName = "";

            if (HttpContext.Current != null)
            {
                try {
                    serverName = $"{HttpContext.Current.Request.ServerVariables["SERVER_NAME"]}";
                    if (Regex.IsMatch(serverName, "localhost", RegexOptions.IgnoreCase))
                    {
                        return(ex.getLine().Replace(Folders.pathApp, "").Replace("\n", "<br />") + "<br />" + description);
                    }
                } catch { }
            }
            return(ex.Message);
        }
All Usage Examples Of Exception::getLine