首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

大俠們,do me a favor!很急解决方法

2012-02-07 
大俠們,do me a favor!很急。。。vb.net我在本機上編譯的時候ok的,可以在別的服務器上就出錯,錯誤描述如下:代

大俠們,do me a favor!很急。。。
vb.net我在本機上編譯的時候ok的,可以在別的服務器上就出錯,錯誤描述如下:
代碼部分:
注:1174   line不註釋的話也是一樣哦!
Line   1170:                 Dim   mail   As   MailMessage   =   New   MailMessage
Line   1171:                 Dim   sqlstr   As   String
Line   1172:                 Dim   age   As   Integer   =   Left(FormatDateTime(Date.Today,   DateFormat.GeneralDate),   4)   -   LstBirthY.SelectedValue
Line   1173:                 Dim   dbclass   As   DataAccess   =   New   DataAccess
Line   1174:                 'Dim   edate   As   Date   =   Date.Today
 

Source   File:   D:\WEB\AOJS\FRONT\RSPB\AOJS-RSPB.aspx.vb         Line:   1172  

Stack   Trace:  


[FormatException:   Input   string   was   not   in   a   correct   format.]
      Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String   Value,   NumberFormatInfo   NumberFormat)   +195
      Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String   Value,   NumberFormatInfo   NumberFormat)   +84

[InvalidCastException:   Cast   from   string   "4/17 "   to   type   'Double '   is   not   valid.]
      Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String   Value,   NumberFormatInfo   NumberFormat)   +172
      Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String   Value)   +7
      AOJS.AOJS_RSPB.ImgBtnOkLogin_Click(Object   sender,   ImageClickEventArgs   e)   in   D:\WEB\AOJS\FRONT\RSPB\AOJS-RSPB.aspx.vb:1172
      System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs   e)   +109
      System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String   eventArgument)   +70
      System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler   sourceControl,   String   eventArgument)   +18
      System.Web.UI.Page.RaisePostBackEvent(NameValueCollection   postData)   +33
      System.Web.UI.Page.ProcessRequestMain()   +1292

 



[解决办法]
看样子好象你只需要用年份,那就用
Date.Today.Year


另外,Integer.Parse( string ) 正确执行的前提是你必须保证 string 是有效格式(可正确转换为 Integer)
[解决办法]
需要SMTP的配置

热点排行