在TextBox中打开记事本文件

编程入门 行业动态 更新时间:2024-10-26 10:34:30
本文介绍了在TextBox中打开记事本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两个问题: (1)我只想检查.txt文件是否为空(没有 打开它) 。就像我单击一个命令按钮然后它应该给出消息 EMPTY如果为空并且显示消息NON EMPTY如果它不是空的。 (2)在VB文本中打开记事本文件(C:\ XYZ \ abc.txt)有哪些步骤 Box。 谢谢

I have two questions: (1) I just want to check whether a .txt file is empty or not (without opening it). Like I click on a command button then it should give message EMPTY if is empty and show message "NON EMPTY" if it is not empty. (2) What are the steps to open a notepad file (C:\XYZ\abc.txt) in a VB Text Box. Thanks

推荐答案

使用System.io.FileInfo类。 你会发现很多东西。 =) -CJ " Sender" <我们** @ domain>在留言中写道 news:ui **************** @ TK2MSFTNGP12.phx.gbl ... Use the System.io.FileInfo class. you''ll find much reading on that. =) -CJ "Sender" <us**@domain> wrote in message news:ui****************@TK2MSFTNGP12.phx.gbl... 我有两个问题: (1)我只想检查一个.txt文件是否为空(没有打开它)。就像我单击一个命令按钮然后它应该给出消息 EMPTY如果是空的并且显示消息NON EMPTY如果它不是空的。 (2)在VB 文本框中打开记事本文件(C:\ XYZ \ abc.txt)的步骤是什么。 /> 谢谢 I have two questions: (1) I just want to check whether a .txt file is empty or not (without opening it). Like I click on a command button then it should give message EMPTY if is empty and show message "NON EMPTY" if it is not empty. (2) What are the steps to open a notepad file (C:\XYZ\abc.txt) in a VB Text Box. Thanks

" Sender" <我们** @ domain> schrieb "Sender" <us**@domain> schrieb 我有两个问题: (1)我只想检查.txt文件是否为空(不打开它)。就像我点击一个命令按钮然后它应该给消息EMPTY如果是空的并且显示消息NON EMPTY如果它不是空的。 空文件是size = 0的文件? 使用Microsoft.VisualBasic.FileSystem.FileLen。 (2)在一个 VB文本框中打开记事本文件(C:\ XYZ \ abc.txt)的步骤是什么。 I have two questions: (1) I just want to check whether a .txt file is empty or not (without opening it). Like I click on a command button then it should give message EMPTY if is empty and show message "NON EMPTY" if it is not empty. An empty file is a file with size = 0? Use Microsoft.VisualBasic.FileSystem.FileLen. (2) What are the steps to open a notepad file (C:\XYZ\abc.txt) in a VB Text Box.

设置文本框''multiline property = True。另请参阅: < F1> Visual Studio.NET Visual Basic和Visual C# 参考 Visual Basic语言 Visual Basic语言导览 - >处理驱动器,文件夹和文件 .NET Framework 使用.NET Framework编程 - >使用I / O - Armin - 代表目录的树已从 本地化(德语)版本。请原谅轻微的偏差。

Set the Textbox'' multiline property = True. See also: <F1> Visual Studio.NET Visual Basic and Visual C# Reference Visual Basic language Visual Basic Language Tour -> Processing drives, folders and files .NET Framework Programming with .NET Framework -> Working with I/O -- Armin - The tree representing the table of contents has been translated from localized (German) version. Excuse slight deviations.

以流形式读取文件,并将流的内容分配到 文本框。你必须先把它转换为ASCII表示法。 看看这个链接..它应该让你通过它。 http://www-tcsn.experts-exchange ... _20670042.html HTH, Bill " Sender" <我们** @ domain>在留言中写道 news:ui **************** @ TK2MSFTNGP12.phx.gbl ... Read the file in as a stream and assign the contents of the stream to the text box. You''ll have to convert it first to an ASCII Representation.. check out this link..it should get you through it. www-tcsn.experts-exchange..._20670042.html HTH, Bill "Sender" <us**@domain> wrote in message news:ui****************@TK2MSFTNGP12.phx.gbl... 我有两个问题: (1)我只想检查一个.txt文件是否为空(没有打开它)。就像我单击一个命令按钮然后它应该给出消息 EMPTY如果是空的并且显示消息NON EMPTY如果它不是空的。 (2)在VB 文本框中打开记事本文件(C:\ XYZ \ abc.txt)的步骤是什么。 /> 谢谢 I have two questions: (1) I just want to check whether a .txt file is empty or not (without opening it). Like I click on a command button then it should give message EMPTY if is empty and show message "NON EMPTY" if it is not empty. (2) What are the steps to open a notepad file (C:\XYZ\abc.txt) in a VB Text Box. Thanks

更多推荐

在TextBox中打开记事本文件

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

发布评论

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

>www.elefans.com

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