vb.net: is it possible to comment out more than 1 line of code at a time?

前端 未结 5 502
春和景丽
春和景丽 2021-01-12 13:57

i know in java and other nice languages it\'s possible to comment out a bunch of lines at the same time. is it possible to do this in vb.net?

相关标签:
5条回答
  • 2021-01-12 14:32

    No it is not you need to comment out each line individually

    0 讨论(0)
  • 2021-01-12 14:34

    Yup. Select the text and then press Ctrl-K, Ctrl-C. And you can uncomment it using Ctrl-K, Ctrl-U.

    0 讨论(0)
  • 2021-01-12 14:44

    You can use conditional compilation to achieve the same effect:

    
    #If False Then
    
    Dim parameters() As SqlParameter = _
    { _
        New SqlParameter("@program_year", programYear), _
        New SqlParameter("@report_id", reportId), _
        New SqlParameter("@report_group", reportGroup), _
        New SqlParameter("@report_period", reportPeriod) _
    }
    Return SqlHelper.ExecuteDataSet(Report.ConnectionString, kSql, parameters, CommandType.StoredProcedure)
    
    #End If
    
    0 讨论(0)
  • 2021-01-12 14:47

    If you edit VB in emacs, you just do M-x comment-region.

    0 讨论(0)
  • 2021-01-12 14:56

    If you mean syntactically, like /* ... */ in C++, then no. But if you mean from your IDE, then from Visual Studio:

    • Highlight the text you want to comment out
    • Type Ctrl+K, then Ctrl+C
    • You can also uncomment text using Ctrl+K, then Ctrl+U
    0 讨论(0)
提交回复
热议问题