Class unable to use server.mappath () function ~
Copyright Notice: 9CBS is this BLOG managed service provider. If this paper involves copyright issues, 9CBS does not assume relevant responsibilities, please contact the copyright owner directly with the article Author.
Since there is no inheritance of the PAGE class in the class, the service uses the server.mappath () function. So implement this feature, we need to do the following.
First, you must reference the System.Web namespace, then use the following method to get the path ~
String strpath = system.Web.httpContext.current.server.mappath ("test.txt");