Server.MapPath - Physical path given, virtual path expected

后端 未结 2 713
一向
一向 2020-11-29 04:13

I\'m using this line of code:

var files = Directory.GetFiles(Server.MapPath(\"E:\\\\ftproot\\\\sales\"));

to locate files in a folder howev

相关标签:
2条回答
  • 2020-11-29 04:47

    if you already know your folder is: E:\ftproot\sales then you do not need to use Server.MapPath, this last one is needed if you only have a relative virtual path like ~/folder/folder1 and you want to know the real path in the disk...

    0 讨论(0)
  • 2020-11-29 04:56
    var files = Directory.GetFiles(@"E:\ftproot\sales");
    
    0 讨论(0)
提交回复
热议问题