开发者

Get Directory App_Data in A Static Helper File

开发者 https://www.devze.com 2022-12-19 03:09 出处:网络
What am I supposed to write as CategoryPath to get the file in the App_Data folder? Thanks /// <summary>

What am I supposed to write as CategoryPath to get the file in the App_Data folder?

Thanks

/// <summary>
/// Summary description for XMLHelper
/// </summary>
public static class XMLHelper
{
    public static string CategoryPath = "App_Data/Categories.xml";
    public static void InsertCategory(string categoryName, string moderator)
    {
        XElement cat = XElement.Load(CategoryPa开发者_StackOverflow社区th);


Try

 AppDataDir = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"App_data")

Then just append the filename required. I haven't tested that code.

Hope it helps

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号