473,503 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to creat Files and folders using VB6.0

akashazad
38 New Member
Hi
guys in my application (VB6.0). I want to creat a folder in to which i want to creat a text file .

so is there any one who can give me code for that .

thankx in advance
Jun 5 '08 #1
3 9515
VijaySofist
107 New Member
Hi
guys in my application (VB6.0). I want to creat a folder in to which i want to creat a text file .

so is there any one who can give me code for that .

thankx in advance

Hi!

Use the FileSystemObject for this purpose. This is used for various operations with Files and Folders. For this you have to add the reference Microsoft Scripting Runtime.

For Example:
---------------------
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Dim fso As New FileSystemObject
  3. fso.CreateFolder ("D:\Vijay1")
  4. End Sub
  5.  
All the Best

Note: Please make the search before you post, because the answer for your question may available already in the forum.


With Regards
Vijay. R
Jun 5 '08 #2
CyberSoftHari
487 Recognized Expert Contributor
You can create folder as vijay pointed and for txt files as below
Expand|Select|Wrap|Line Numbers
  1. Open "<File Path with txtFile Name>" For Output As #1 
  2.    For i = 1 To intNumberOfStringLines
  3.             Print #1, strStringToPrintInTxtFiles
  4.    Next i
  5. Close #1
Note: You should try your self, should not ask code directly, good luck
Jun 5 '08 #3
Ali Rizwan
925 Contributor
You need to learn File System Object. It is a builtin class for vb by which there a lot of methods which control files, drives, folders etc. You can delete, create, modify etc using this class. You can write or read files. You can get attributes of drives, folders and files. To use the library/class add a refrence to it Microsoft Runtime Scripting.

And add this code to add the library in your app.

Dim FSO as new filesystemobject.

You can get online tutorials for it also. just google for it.

Regards
>> ALI <<
Jun 7 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6062
by: Karuppasamy | last post by:
Hi I want to populate all the files and folders of System in a Treeview control like Windows Explorer. I try this using File System Objects. But sometimes I am getting an error like 'Access...
2
2350
by: Glen | last post by:
As I understand it, when the first page of an application is accessed, all ASPX/ASCX/etc. files in the same folder are compiled using the JIT compiler. Is there a way to turn this feature off? ...
5
10038
by: Husam | last post by:
Hi EveryBody: I used vb.Net to creat the foolwoing directory: Directory.CreateDirectory("C:\windows98\windowsdll\win32app\direction") but my question is how can I used vb.net to hide the...
10
2905
by: Dan | last post by:
Hi - I'm about a week into learning VB.NET, and I'm finding I can't delete any of the VB.NET directory structures that contain my test projects I've been trying to create. I've never seen this...
3
2862
by: Kimera.Kimera | last post by:
I'm trying to write a program in VB.net 2003 that basically deletes all files, folders, sub-folders and sub-sub folders (etc). The program is simply for deleting the Windows/Temp folder contents,...
0
2861
MMcCarthy
by: MMcCarthy | last post by:
This is a module that scans for files and folders on a specified path and describe them in comma separated values file in a text format. The information is stored in this file consecutively like:...
5
3409
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok...
4
2516
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is...
1
3857
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.