这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Howtodownloadxmlfileinasp.netusingC#任何人都可以帮助如何下载xml(在字符串中)。我正在使用MVC3我的代码;publicFileResultDownload(stringid){varmodel=service.GetAllDefinitions().First(x=>x.ID==id);vardefinitionDetails=newStatisticDefinitionModel(model);stringxmlString=definitionDetails.ToX