首页 > 解决方案 > Visual Basic,使应用程序仅在特定文件夹中打开

问题描述

有没有一种方法可以让 Visual Basic .net 应用程序仅在它位于特定文件夹/路径中或者它包含文件夹内的某个元素时才打开?谢谢。

标签: vb.net

解决方案


简单,加载事件:

If not Application.StartupPath() = "C:\" then
    Application.Exit()
End if

推荐阅读