Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3456168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:42:12+00:00 2026-05-18T09:42:12+00:00

I can easily do this in C#…but I need the equivalent in VB.Net. I

  • 0

I can easily do this in C#…but I need the equivalent in VB.Net. I need to be able to implement various IAsyncResult properties in VB.Net.

IN C#

Works like a champ…

public object AsyncState { get; set; }

IN VB.NET – THIS FAILS

This fails because you cannot overload a property in VB.Net

Public ReadOnly Property AsyncState() As Object Implements IAsyncResult.AsyncState
    Get
        '... the GET's code goes here ...
    End Get
End Property
Public WriteOnly Property AsyncState() As Object
    Set(ByVal value As Object)
        '... the SET's code goes here ...
    End Set
End Property

IN VB.NET – BOTH THESE FAIL

This fails the “must implement IAsyncResult” requirement

Public AsyncState As Object
Public AsyncState As Object Implements IAsyncResult.AsyncState
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:42:12+00:00Added an answer on May 18, 2026 at 9:42 am

    This did the trick…

        Public Class AsyncResult
            Implements IAsyncResult
    
    #Region "CONSTRUCTORS"
    
            Public Sub New(ByVal callback As AsyncCallback, ByVal context As HttpContext)
                _asyncCallback = callback
                _httpContext = context
                _createdTime = DateTime.Now
            End Sub
    
    #End Region
    
    #Region "PROPERTIES"
    
            Public Const TimeoutSeconds As Integer = 3
    
            Private _asyncCallback As AsyncCallback
            Private _httpContext As HttpContext
            Private _createdTime As DateTime
    
            Public ReadOnly Property TimedOut() As Boolean
                Get
                    Return ((DateTime.Now - _createdTime).TotalSeconds >= TimeoutSeconds)
                End Get
            End Property
            Public Property Response() As Response
                Get
                    Return m_Response
                End Get
                Set(ByVal value As Response)
                    m_Response = value
                End Set
            End Property
            Private m_Response As Response
    
    #Region "IAsyncResult Members"
    
            Public ReadOnly Property HttpContext() As HttpContext
                Get
                    Return _httpContext
                End Get
            End Property
            Public ReadOnly Property AsyncState() As Object Implements IAsyncResult.AsyncState
                Get
                    Return m_AsyncState
                End Get
                'Set(ByVal value As Object)
                '    m_AsyncState = value
                'End Set
            End Property
            Private m_AsyncState As Object
    
            Private ReadOnly Property IAsyncResult_AsyncWaitHandle() As System.Threading.WaitHandle Implements IAsyncResult.AsyncWaitHandle
                Get
                    Throw New NotImplementedException()
                End Get
            End Property
    
            Private ReadOnly Property IAsyncResult_CompletedSynchronously() As Boolean Implements IAsyncResult.CompletedSynchronously
                Get
                    Return False
                End Get
            End Property
    
            Public ReadOnly Property IsCompleted() As Boolean Implements IAsyncResult.IsCompleted
                Get
                    Return m_isCompleted
                End Get
                'Set(ByVal value As Boolean)
                '    If Not value Then
                '        Return
                '    End If
    
                '    Me.m_isCompleted = True
                '    _asyncCallback(Me)
                'End Set
            End Property
            Private m_isCompleted As Boolean = False
    
    #End Region
    
    #End Region
    
    #Region "METHODS"
    
            Public Function ProcessRequest() As Boolean
    
                ' Any "Execution" code goes here...
    
                Return Me.IsCompleted
            End Function
    #End Region
    
        End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.