Class unable to use server.mappath () function ~

zhaozj2021-02-16  63

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");

转载请注明原文地址:https://www.9cbs.com/read-16234.html

New Post(0)