开发者

Could not find a part of the path (asp.net)

开发者 https://www.devze.com 2023-03-23 18:16 出处:网络
Hi I keep getting this error: Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of th开发者_开发技巧e path \'D:\\Websites\\site_sitecore\\Website\\Template\\claim.htm\'.

Hi I keep getting this error:

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of th开发者_开发技巧e path 'D:\Websites\site_sitecore\Website\Template\claim.htm'.

The code I'm using is:

message.BodyFileName = "/Template/claim.htm";

Basically trying to send an email template via email but I can't get it to find the path. If I use a external link with that file it denies access to it but can't work out how to get the correct path to work internally, any ideas?


Use Server.MapPath('~/Template/claim.htm'). Does that work?


try message.BodyFileName = "Template/claim.htm";

0

精彩评论

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

关注公众号