两个简单问题,解决马上给分,在线等待!!!

bingningmeng 2003-05-22 05:31:53
1.如何获得当前的文件路径?
2.对连接字符串应该怎么保存才比较好?
保存到文件还是保存到注册表?
应该怎么实现
...全文
49 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
runagate 2003-05-23
  • 打赏
  • 举报
回复
1. Directory.GetCurrentDirectory 方法
Public Shared Function GetCurrentDirectory() As String
2.保存到注册表比较好,不容易被损坏,现在流行的趋势也是保存到注册表而不是保存到ini文件萨
Registry Functions
The following functions are used with the registry.

Function Description
RegCloseKey Releases a handle to the specified registry key.
RegConnectRegistry Establishes a connection to a predefined registry handle on another computer.
RegCreateKeyEx Creates the specified registry key.
RegDeleteKey Deletes a subkey.
RegDeleteValue Removes a named value from the specified registry key.
RegDisablePredefinedCache Disables the predefined registry handle table of HKEY_CURRENT_USER for the specified process.
RegEnumKeyEx Enumerates subkeys of the specified open registry key.
RegEnumValue Enumerates the values for the specified open registry key.
RegFlushKey Writes all the attributes of the specified open registry key into the registry.
RegGetKeySecurity Retrieves a copy of the security descriptor protecting the specified open registry key.
RegLoadKey Creates a subkey under HKEY_USERS or HKEY_LOCAL_MACHINE and stores registration information from a specified file into that subkey.
RegNotifyChangeKeyValue Notifies the caller about changes to the attributes or contents of a specified registry key.
RegOpenCurrentUser Retrieves a handle to the HKEY_CURRENT_USER key for the user the current thread is impersonating.
RegOpenKeyEx Opens the specified registry key.
RegOpenUserClassesRoot Retrieves a handle to the HKEY_CLASSES_ROOT key for the specified user.
RegOverridePredefKey Maps a predefined registry key to a specified registry key.
RegQueryInfoKey Retrieves information about the specified registry key.
RegQueryMultipleValues Retrieves the type and data for a list of value names associated with an open registry key.
RegQueryValueEx Retrieves the type and data for a specified value name associated with an open registry key.
RegReplaceKey Replaces the file backing a registry key and all its subkeys with another file.
RegRestoreKey Reads the registry information in a specified file and copies it over the specified key.
RegSaveKey Saves the specified key and all of its subkeys and values to a new file.
RegSetKeySecurity Sets the security of an open registry key.
RegSetValueEx Sets the data and type of a specified value under a registry key.
RegUnLoadKey Unloads the specified registry key and its subkeys from the registry.
mainone 2003-05-22
  • 打赏
  • 举报
回复
当前路径: application.StartupPath &"\*.xml"
写注册表用win32.register
citylamp 2003-05-22
  • 打赏
  • 举报
回复
1、如是本机的,用System.Environment.CurrentDirectory 实现
System.Environment.CurrentDirectory = "f:\" '操作当前的工作目录
txtCommand.Text = System.Environment.CurrentDirectory.ToString '当前目录写入textbox控件
2、可放在在GLOBAL.ASAX中
xiajianfeng 2003-05-22
  • 打赏
  • 举报
回复
1.Server.Path
2.放在web.config里
liangfang 2003-05-22
  • 打赏
  • 举报
回复
1.什么当前,是不是根目录 可以.用.path 属性
2.随你,一般保存文件好点,因为绿色

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧