vfp6.0怎样将新建的文本文档中的内容显示到表单Text1中,急求代码!路过勿扰!!
2个回答
展开全部
这是vfp的帮助的一段示例代码,你只需要吧读出的内容赋值给textbox就可,希望对你有帮助!
Local gnFileHandle,nSize,cString
gnFileHandle = FOPEN("test.txt")
* Seek to end of file to determine number of bytes in the file.
nSize = FSEEK(gnFileHandle, 0, 2) && 移动指针到末尾
IF nSize <= 0
* If file is empty, display an error message.
WAIT WINDOW "This file is empty!" NOWAIT
ELSE
* If file is not empty, store the file's contents in memory
* and display the text in the main Visual FoxPro window.
= FSEEK(gnFileHandle, 0, 0) && 移动指针到开始
cString = FREAD(gnFileHandle, nSize)
? cString
&&这个变量赋值给textbox。value
ENDIF
= FCLOSE(gnFileHandle) && 关闭文件
Local gnFileHandle,nSize,cString
gnFileHandle = FOPEN("test.txt")
* Seek to end of file to determine number of bytes in the file.
nSize = FSEEK(gnFileHandle, 0, 2) && 移动指针到末尾
IF nSize <= 0
* If file is empty, display an error message.
WAIT WINDOW "This file is empty!" NOWAIT
ELSE
* If file is not empty, store the file's contents in memory
* and display the text in the main Visual FoxPro window.
= FSEEK(gnFileHandle, 0, 0) && 移动指针到开始
cString = FREAD(gnFileHandle, nSize)
? cString
&&这个变量赋值给textbox。value
ENDIF
= FCLOSE(gnFileHandle) && 关闭文件
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
thisform.Text1.value="你输入的内容"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询