 Rank: YAF Forumling
Joined: 10/23/2008 Posts: 3 Location: HCM
|
I get an error skip day my forum run susccess . ( one day nomalize/ one day error/ ...) Code:Server Error in '/forum' Application. Length cannot be less than zero. Parameter name: length Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length] System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7490999 yaf.pages.forum.FullTimeVN(String orgDate) +120 yaf.pages.forum.BindData() +3552 yaf.pages.forum.Page_Load(Object sender, EventArgs e) +741 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 3,045 Location: Honolulu, HI
|
I'm pretty sure you are running a customized version of YAF. I know the codebase pretty well and there is no function "FullTimeVN"... The function naming isn't even in accordance to how the project is designed. Sorry, you'll need to contact the person who modified the forum software. "When you are grateful, fear disappears and abundance appears”." 
|
 Rank: YAF Forumling
Joined: 10/23/2008 Posts: 3 Location: HCM
|
Jaben wrote:I'm pretty sure you are running a customized version of YAF. I know the codebase pretty well and there is no function "FullTimeVN"... The function naming isn't even in accordance to how the project is designed.
Sorry, you'll need to contact the person who modified the forum software. Uh, I modified to format DateTime to Vietnamese type.This is my code 2 funtion : Code: /TimeVN convert AM/PM => Sáng/Chiều protected string TimeVN( string orgDate) { if (orgDate.Length > 0) { string o = ""; if (orgDate.IndexOf("PM") != -1) { o = orgDate.Replace("PM", "Chiều"); } else { o = orgDate.Replace("AM", "Sáng"); } return o; } else return orgDate; }
/FullTimeVN convert Friday, October 24, 2008 hh:mm:ss AM/PM =>Thứ ? , Ngày(Date) Tháng(Month) Năm(Year) hh:mm:ss Sáng/Chiều protected string FullTimeVN(string orgDate) { if (orgDate.Length > 0) { string o = ""; string tmp = ""; if (orgDate.IndexOf("PM") != -1) { o = orgDate.Replace("PM", "Chiều"); } else { o = orgDate.Replace("AM", "Sáng"); } tmp = orgDate.Substring(0, orgDate.IndexOf(",")); if (tmp.Length > 0) { switch (tmp) { case "Monday": o = orgDate.Replace(tmp, "Thứ hai"); break; case "Tuesday": o = orgDate.Replace(tmp, "Thứ ba"); break; case "Wednesday": o = orgDate.Replace(tmp, "Thứ tư"); break; case "Thursday": o = orgDate.Replace(tmp, "Thứ năm"); break; case "Friday": o = orgDate.Replace(tmp, "Thứ sáu"); break; case "Saturday": o = orgDate.Replace(tmp, "Thứ bảy"); break; case "Sunday": o = orgDate.Replace(tmp, "chủ nhật"); break; } } tmp = orgDate.Substring(orgDate.IndexOf(",") + 2, orgDate.LastIndexOf(",") - orgDate.IndexOf(",") - 2); string tmpDay = tmp.Substring(tmp.IndexOf(" ") + 1); tmpDay = "ngày " + tmpDay; string tmpMonth = tmp.Substring(0, tmp.IndexOf(" ")); if (tmpMonth.Length > 0) { switch (tmpMonth) { case "January": tmpMonth = " tháng 1"; break; case "February": tmpMonth = " tháng 2"; break; case "March": tmpMonth = " tháng 3"; break; case "April": tmpMonth = " tháng 4"; break; case "May": tmpMonth = " tháng 5"; break; case "June": tmpMonth = " tháng 6"; break; case "July": tmpMonth = " tháng 7"; break; case "August": tmpMonth = " tháng 8"; break; case "September": tmpMonth = " tháng 9"; break; case "October": tmpMonth = " tháng 10"; break; case "November": tmpMonth = " tháng 11"; break; case "December": tmpMonth = " tháng 12"; break; } } o = o.Replace(tmp, tmpDay + tmpMonth); o = TimeVN(o); return o; } else return orgDate; }
|
| Users browsing this topic |