Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 4th, 2007, 12:36 PM
Authorized User
 
Join Date: May 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default use My.Computer.FileSystem.ReadAllText in webdesin

Hi,

what can i use insted of my.computer.filesystem.readalltext when making aspx/aspx.vb pages? I can use this, but its only working localy and not when accessing the website from internet, is there an alternativ that can be used to access the filesystem on the IIS server?

Please help!

 
Old July 4th, 2007, 09:02 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Do you want to actually access the web server's files? What files are you looking to access? I don't see anything specific suggested. Can you provide more detail?

-Peter
 
Old July 5th, 2007, 05:59 PM
Authorized User
 
Join Date: May 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The project can be working and running "Localhost", no problem.
(code: My.Computer.FileSystem.WriteAllText(People, _
           FirstName.Text & "<br>", True
....................)
 Then I post website, I got error message below:

 Name 'My' is not declared in website for file system.

How to fix?
Please let me know. Thanks.


 
Old July 5th, 2007, 06:10 PM
Authorized User
 
Join Date: May 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, Peter,

I have a web form. It work normally on localhost. However, I post on Website, I got the error message below:

Compiler Error Message: BC30451: Name 'My' is not declared.

Source Error:

Line 9: GBdate = "c:\inetpub\wwwroot\webform\GBdate .txt"
Line 10:
Line 11: If My.Computer.FileSystem.FileExists(GBdate) Then
Line 12: WholeList = My.Computer.FileSystem.ReadAllText(GBdate)
Line 13: Response.Write(WholeList & "<br>")


Source File: D:\Webs\webform\view.aspx Line: 11

 please help. Thanks.


 
Old July 5th, 2007, 08:52 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

So just do this instead:

If FileExists(GBdate) then
...code
end if

You need to import the System.IO namespace.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with code: My.Computer.FileSystem Sporty BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 April 23rd, 2007 05:05 AM
Problem with code: My.Computer.FileSystem Sporty Visual Basic 2005 Basics 0 March 14th, 2007 03:52 PM
My.Computer.Filesystem run-time 424 error insidertrader Beginning VB 6 2 September 27th, 2006 02:43 PM
Using The FileSystem Object Ben Horne Classic ASP Basics 1 December 1st, 2003 09:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.