学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
轻松建立自己的群组,招兵买马   
发新话题
打印

怎样获取当前目录?

怎样获取当前目录?

我用windows的API函数GetCurrentDirectory()获取当前的文件目录,
但是返回一行乱码。
请文是什么问题?如何解决?请多赐教!

[此贴子已经被作者于2006-3-2 9:26:25编辑过]

TOP

多谢关注!

在师兄的帮助下,我找到答案了:
在声明函数时,调用ansi进行校正,
function ulong GetCurrentDirectory(参数略)"kernel32.dll" alias for "GetCurrentDirectoryA;anis"
千万不要把函数大小写搞错咯!

TOP

如果是PB8或PB9直接用GetCurrentDirectory()
Description

Gets the current directory for your target application.

Syntax

GetCurrentDirectory ( )

Return value

String. Returns the full path name for the current directory.

This example puts the current directory name in a SingleLineEdit control:

sle_1.text = GetCurrentDirectory( )

乌龟学堂http://www.51pb.com 承接各种软件开发、系统集成、网络搭建。 QQ:124030710

TOP

发新话题