rt,代码如下:
Imports System 
Imports System.Web 
Imports System.Web.UI Namespace MySpace Public Class My
 Inherits System.Web.UI.Page    Protected Button As System.Web.UI.WebControls.Button   Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
    Show = "ABC"
   End Sub    Public Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
          Response.Write(Show)   End Sub   Public Property Show() As String
      Get
      Return "CHINA"
      End Get
  Set 
      Show = value
      End Set
   End Property
 End Class 
End Namespace
现我对 Show = "ABC"进行操作时,就出错:发生类型为 System.StackOverflowException 的异常。 请问如何解决?请大家指点.

解决方案 »

  1.   

    Set 
          Show = value
          End Set这个Show又回到了他本身,死循环
      

  2.   

    再声明一个变量private _show as stringget
       return _showend get
    set
        _show = value
      

  3.   

    谢谢cpp2017(慕白兄).以后我有什么问题可以同你请教吗?可以留下你的联系方式吗?非常谢谢.
      

  4.   

    不用客气.
    [email protected]
      

  5.   

    不好意思,楼上的,是灌水出来的可以了吧.
    cpp2017(慕白兄) ,那以下的代码为什么不用新建变量也是可行的呢?
     Public Property PageSize() As Integer 
         Get 
           Return Me.DataGrid1.PageSize 
         End Get 
         Set 
           PageSize = value 
         End Set 
       End Property
      

  6.   

    Click the link to solve your problem.Good luck!