2011-07-21 23 views
1

我嘗試讀取ItemAdding(SharePoint2010)中的文件。 我用這個代碼:無法讀取ItemAdding事件接收器中的文件

public override void ItemAdding(SPItemEventProperties properties) 
{ 
XmlDocument doc = new XmlDocument(); 
string file = Path.Combine(properties.WebUrl, properties.AfterUrl); 
doc.Load(file); 
} 

但程序返回錯誤在doc.Load(file); - 遠程服務器返回錯誤:(401)未經授權。如何解決這個問題呢?

回答