不需要定义全局变量,你可以直接这样写
Dim success As Boolean = Falsestatic mu = new System.Threading.Mutex(True, "abcdefg", success)msgbox(success)