Hash sign (#) in VB.NET

前端 未结 2 967
孤城傲影
孤城傲影 2021-01-15 09:12

I have this legacy code that I am working with and there is code like this all over the place:

    #If PRE611 = True Then
        \'Do Something
    #Else
                


        
2条回答
  •  耶瑟儿~
    2021-01-15 09:42

    Those are directives, and allows you to do conditional compiling. # sign used for directives.

    In this case It will compiled either part of the code based on the evaluation of "PRE611 = True"

    You can see this article for some examples : http://visualbasic.about.com/od/usingvbnet/a/vbdirectives01_2.htm

提交回复
热议问题