*Need Help on coding*
*Need Help on coding*
*Need Help on coding*
*Need Help on coding*
*Need Help on coding*
*Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding*
*Need Help on coding* *Need Help on coding*
*Need Help on coding*
Go Back  Xtreme Visual Basic Talk > > > *Need Help on coding*


Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2008, 02:04 PM
badlog badlog is offline
Newcomer
 
Join Date: Aug 2008
Posts: 4
Question *Need Help on coding*


Hi guys, im fairly new to vb and to this fourm but i really would like to know the code for opening a file without a dialog (ex: no browse just open the file right away) in Visualy Basic Express 2008

Thanks, badlog
Reply With Quote
  #2  
Old 08-17-2008, 03:06 PM
unclebill unclebill is offline
Junior Contributor
 
Join Date: Apr 2003
Location: San Diego, CA
Posts: 308
Default

For a start, look in the Help for Open statement. This will give you several options depending on the file mode you need to use for your specific purpose.
Reply With Quote
  #3  
Old 08-18-2008, 12:32 AM
badlog badlog is offline
Newcomer
 
Join Date: Aug 2008
Posts: 4
Default

you mean in the visual basic program? Thanks!
Reply With Quote
  #4  
Old 08-18-2008, 08:17 AM
gpraceman's Avatar
gpraceman*Need Help on coding* gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

Check out the .NET File I/O and Registry section of this forum. You'll find file I/O examples there.
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #5  
Old 08-18-2008, 03:14 PM
badlog badlog is offline
Newcomer
 
Join Date: Aug 2008
Posts: 4
Default

Yes i looked there but isnt there an easier way to open a file? all i want is when someone clicks a button in my windowsforumsapp that it will open a file?
Reply With Quote
  #6  
Old 08-18-2008, 03:22 PM
gpraceman's Avatar
gpraceman*Need Help on coding* gpraceman is offline
Contributor

* Expert *
 
Join Date: Sep 2002
Location: Highlands Ranch, CO
Posts: 560
Default

If you already know the filename and location then just use file I/O to open and read it. If you are expecting the user to provide that info then you should use a file open dialog.
__________________
Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Reply With Quote
  #7  
Old 08-18-2008, 04:23 PM
wayneph's Avatar
wayneph*Need Help on coding* wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Are you trying to open it in your application? Or just start up Notepad (or the default text editior) with the file.

You really haven't told anyone what you're trying to accomplish. We can only help if you tell us what you're trying to do, and what you've tried...
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #8  
Old 08-18-2008, 06:48 PM
TomHannalin TomHannalin is offline
Regular
 
Join Date: Feb 2006
Posts: 96
Default

I expect that you are looking open a file in its default program - i.e. the same as double-clicking a file. If this is the case then do a search for 'Shell' - as I dont know specifically how to do this .Net.
Reply With Quote
  #9  
Old 08-19-2008, 12:28 AM
badlog badlog is offline
Newcomer
 
Join Date: Aug 2008
Posts: 4
Default

Sorry bout that ... What I am trying to do is that I have made an application, and I have made a .bat file in which I wrote a script. I have also put anbutton on my application. When I click that button I want my batch file to run as if it was on your desktop and you were double-clicking it.


Thanks for all the help so far



Edit: also I have tried using the code fileopen.file as stated in the visual express help but it doesn't work... Says that "file" is not declared

Last edited by badlog; 08-19-2008 at 12:33 AM. Reason: Need to make change
Reply With Quote
  #10  
Old 08-19-2008, 01:53 AM
Roger_Wgnr's Avatar
Roger_Wgnr Roger_Wgnr is offline
CodeASaurus Hex

Forum Leader
* Expert *
 
Join Date: Jul 2006
Location: San Antonio TX
Posts: 2,427
Default

For what you want to do reference Microsoft.Win32 namespace and use the Shell function.
__________________
Code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ~Martin Golding
The user is a peripheral that types when you issue a read request. ~Peter Williams
MSDN Visual Basic .NET General FAQ
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
*Need Help on coding*
*Need Help on coding*
*Need Help on coding* *Need Help on coding*
*Need Help on coding*
*Need Help on coding*
*Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding* *Need Help on coding*
*Need Help on coding*
*Need Help on coding*
 
*Need Help on coding*
*Need Help on coding*
 
-->