2
我試圖在我的Intranet站點上下載InfoPath表單,比如_http://ABC/XYZ/abc/PhysicsDept/Requests/Myform.xml(這是變量formName)使用C#。我使用下面的代碼創建使用C#下載infopath表單作爲XML文件
using (WebClient client = new WebClient())
{
// Set the credentials to be used for download from Sharepoint
client.Credentials = CredentialCache.DefaultCredentials;
client.DownloadFile(formName, "tempForm.xml");
}
tempForm.xml,但遺憾的是它包含了一些奇怪的HTML數據,這是肯定的是,我不想。如果我只是試圖打開鏈接,從formName獲取的值,那麼我可以很容易地將它看作一個XML,所以鏈接是正確的並且正常工作。
任何人都可以請幫我這個嗎?
非常感謝Alexi。我剛剛閱讀了您提供的鏈接上的完整文章。你是對的,添加「?NoRedirect = true」確實工作:) –