如何在vb.net中更改应用程序启动路径?

编程入门 行业动态 更新时间:2024-10-28 13:27:07
本文介绍了如何在vb中更改应用程序启动路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何更改vb(基于窗口的应用程序)应用程序启动路径?

解决方案

(Windows中的启动文件夹实际上是一个开始菜单文件夹,Windows从登录后启动应用程序 - 但我很确定你没有意味着这个......) 含义启动路径是:应用程序启动的路径 - 而不是可执行文件本身的路径。从命令提示符启动应用程序时,它是当前路径。 好​​的,现在不要试图落后于问题的ninsensic方面 - 你可以'更改此项(移动文件本身除外),您可以从一个或另一个路径开始。但是你可以影响工作目录。 1)您可以更改应用程序工作目录:msdn.microsoft/en-us/library/system.io.directory.setcurrentdirectory(v=vs.110 ).aspx [ ^ ] 2)如果您从代码启动应用程序,则可以指定工作方向:msdn.microsoft/en-us/ library / system.diagnostics.processstartinfo.workingdirectory%28v = vs.110%29.aspx [ ^ ] 3)快捷方式/ Shell链接(.lnk)具有转换启动目录的属性,但这也是最初的worikg目录。例如,你可以使用这个(也来自VB.NET):创建和解析shell链接 [ ^

How can i change the vb ( Window Based Application ) application start up path?

解决方案

(Startup folder in Windows is actually a Start menu folder, from where Windows starts applications after logon - but I am pretty sure you haven't meant this one...) The meaning of startup path is: the path from where the application is started - and not the path of the executable itself. When you start the application from command prompt it is the current path. Ok, now le't try to get behind the ninsensic aspect of the question - you can't change this (except of moving the file itself), you either start from one path or another. But you can influence working directory. 1) You can change application working directory: msdn.microsoft/en-us/library/system.io.directory.setcurrentdirectory(v=vs.110).aspx[^] 2) If you start the app from code, you can specify working directry: msdn.microsoft/en-us/library/system.diagnostics.processstartinfo.workingdirectory%28v=vs.110%29.aspx[^] 3) Shortcuts/Shell links (.lnk) have a property that is translated startup directory, but that is also the initial worikg directory. You can use this one for example (also from VB.NET): Creating and Resolving shell links[^]

更多推荐

如何在vb.net中更改应用程序启动路径?

本文发布于:2023-11-03 11:59:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555097.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   路径   如何在   net   vb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!