How to get server local drive path in vb.net? -


this code c#.

 protected string vault = system.configuration.configurationsettings.appsettings["documentvault"];  

the above code use drive c path @ server. how can drive c path in vb.net?

the verbatim translation code vb.net is:

protected vault string = system.configuration.configurationsettings.appsettings("documentvault") 

and in web.config you'll need corresponding key:

<configuration>        ....      <appsettings>        <add key="documentvault" value="c:\somepath\somewhere\else\"/>      </appsettings>     .... </configuration> 

but per comment:

"i want path location of web app.but how in vb.net?"

you'll need map path of root of app:

protected vault string = server.mappath("~\") trace.write(vault) ' <-- should return physical root path of web application 

Comments