返回首页

亲爱的朋友,

我的工作。NET Remoting的项目。远程对象,如果有任何异常,我想向客户端发送详细的异常。我用下面的代码来完成,

'This is on a shared .dll

Public Interface ICreateNewMouza

    Function CreateNewMouza(ByVal MouzaToCreate As Mouza) As Integer

End Interface

 

Imports System

Imports System.Runtime.Serialization

 

<serializable()> _

Public Class CustomException

    Inherits System.ApplicationException

 

    Public Sub New(ByVal message As String)

        MyBase.New(message)

    End Sub

 

    Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)

        MyBase.New(info, context)

    End Sub

 

    Public Overrides Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext)

        MyBase.GetObjectData(info, context)

    End Sub

End Class

 

'This is remote object which a client will invoke-



Imports System.Runtime.Remoting

Imports ClassInterfaces

 

Public Class CreateNewMouza

    Inherits MarshalByRefObject

    Implements ClassInterfaces.ICreateNewMouza

 

    Public Function CreateNewMouza(ByVal MouzaToCreate As ClassInterfaces.Mouza) As Integer Implements ClassInterfaces.ICreateNewMouza.CreateNewMouza

        Try

           ' some code

        Catch ex As Exception

          ## what should be here?

        End Try

 

    End Function

End Class
应该是什么在try ..赶块
请帮助我。

提前感谢
SKPaul

回答

评论会员: 时间:2
G