我有一个ASP.NET / C#Web表单,用于为IT部门提供人员操作请求。它通过电子邮件输出,格式化为HTML以提高可读性。但是,我想将其扩展为包含一般人力资源信息,因为大部分信息都是冗余的,无论如何请求者已经发送给HR,导致信息重复。鉴于SSN等信息的存在,我真的不会通过电子邮件发送这些信息,部分原因是我们的系统标记了这种内容。
鉴于此,是否有可能以某种方式将表单数据作为文件(以任何格式 - 我想象PDF-并且最好比普通文本更易于阅读)输出到网络文件夹,理想情况下与发送我发送电子邮件中的非敏感信息然后转发给我们?我知道你可以访问ASP.NET中的网络文件夹(不是我已经完成了它,请注意),但我不知道你是否可以按照我想要的方式将表单输出转储到文件中。 / p>
答案 0 :(得分:1)
The short answer is yes, as long as you have your ASP.NET Web application running with an account (the application pool identity) with sufficient permissions to write to the network share you want to save the file to, you can do this.
A common method is to set up a distinct application pool just for your one web application, and to configure it to use a domain account that is provisioned exclusively for this use. (Some people call them faceless account or system accounts.) Make sure to grant write permissions to the network share where you want to save the files.
Then, use regular System.IO .NET classes to save the files to the network share. There are countless examples of this, so you should easily find one close to what you need.