locked
chat room timer conversion RRS feed

  • Question

  • User693597704 posted

    Hello,

    I am in the process of converting UChat from C# to VB in VWD2010. I ran into an error I can not figure out on the Global.asax file....

    here is the section of code

    <%@ Application Language="VB" %>
    <%@ Import Namespace="ASPNETChat" %>
    <%@ Import Namespace="System.Threading " %>
    
    <script runat="server">
    
        Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
            ' Code that runs on application startup
            System.Threading.Timer (ChatRoomsCleanerTimer = New System.Threading.Timer(New TimerCallback(ChatEngine.CleanChatRooms), null, 1200000, 1200000))
    
        End Sub
    

    the errors I am getting are:
    1) 'Timer' is a type in 'threading' and cannot be used as an expression

    2) ChatRoomsCleanerTimer is not declared. It may be inaccessible due to its protection level ...... maybe declare this up top?

    3) delegate system.threading.timer callback requires an addessOf expression or lambda expression as the only argument to its constructor

    4) Nill constant is no longer supported; use system.DBNull instead........I change this one and then I get the cannot be used as an expression error

    Or maybe someone has an example of a chat program in VB they could point me to.... I have searched all over with no luck only ones I find are in C

     

     

    Thursday, April 17, 2014 9:53 PM

Answers

  • User-166373564 posted

    Hi Steve

    Welcome to asp.net forum.

    System.Threading.Timer (ChatRoomsCleanerTimer = New System.Threading.Timer(New TimerCallback(ChatEngine.CleanChatRooms), null, 1200000

    For VB.Net related questions, I think you could consider getting help from Visual Basic forum, VB experts can help you.

    Thanks for your understanding.

    Best regards

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 22, 2014 2:49 AM