Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   .NET File I/O and Registry (http://www.xtremevbtalk.com/-net-file-i-o-and-registry/)
-   -   Server.MapPath & Class Libraries (http://www.xtremevbtalk.com/-net-file-i-o-and-registry/328168-server-mappath-class-libraries.html)

Andrewhuk 04-18-2016 12:05 PM

Server.MapPath & Class Libraries

If it possible to use server.mappath in a class library? I am trying to put this line in a function within a class file.

dim strPath as String = Server.Mappath("~/uploads/file1.txt")

However I get this error.

'server' is not declared. it may be inaccessible due to its protection level

I have tried adding "imports system.web" but it still does not work.

I also noticed that the system.web only has the following:


Am I doing something wrong?



PlausiblyDamp 04-18-2016 05:24 PM

You would also need to add a reference to the system.web.dll if you want to use this function.

All times are GMT -6. The time now is 11:48 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.