【发布时间】:2015-05-08 23:30:27
【问题描述】:
我有一个小型 VS C# 程序,它修改 HTML 格式的电子邮件签名中的一些数据,稍后将在 Lotus Notes 8.5.3 中使用 每个用户都可以从通用模板生成自己的 .html 文件,其中填充了他的个人数据。
我的问题是,现在我希望软件将 .html 文件保存在 Lotus Notes Data 目录中,然后将客户端配置为使用该特定签名,而无需用户通过菜单“更多-->首选项- ->签名”自己。
到目前为止,这是我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace FirmaCorreo
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
private void Generar_Click(object sender, RoutedEventArgs e)
{
string suSaludo;
suSaludo = Texto1.Text;
string suNombre;
suNombre = Texto2.Text;
string suCargo;
suCargo = Texto3.Text;
string suCargo2;
suCargo2 = Texto4.Text;
string suMovil;
suMovil = Texto5.Text;
string suDirecto;
suDirecto = Texto6.Text;
string suDelegacion;
if (DelegacionVillajoyosa.IsChecked == true)
{
suDelegacion = "Villajoyosa";
}
else if (DelegacionCanarias.IsChecked == true)
{
suDelegacion = "Canarias";
}
else if (DelegacionVigo.IsChecked == true)
{
suDelegacion = "Vigo";
}
else
{
suDelegacion = "Francia";
}
var contents = System.IO.File.ReadAllText(@"C:\Users\Public\Documents\IS-IT\FirmaCorreo\Plantilla\Plantillacorreo.html", Encoding.GetEncoding(28591));
contents = contents.Replace("<!--Saludo-->", suSaludo);
contents = contents.Replace("<!--NombreDelEmpleado-->", suNombre);
contents = contents.Replace("<!--CargoDelEmpleado-->", suCargo);
contents = contents.Replace("<!--CargoDelEmpleado2-->", "<br />"+suCargo2);
contents = contents.Replace("<!--TelefonoMovil-->", "Mobile.- "+suMovil);
contents = contents.Replace("<!--TelefonoDirecto-->", "<br />Direct.- "+suDirecto);
contents = contents.Replace("<!--Delegacion"+suDelegacion, "<!-- -->");
System.IO.File.WriteAllText(@"C:\Users\Public\Documents\IS-IT\FirmaCorreo\Plantilla\PlantillacorreoModificada.html", contents, Encoding.GetEncoding(28591));
}
}
}
在我的 Lotus Notes 8.5.3 安装中,我看到一个 notes.ini 文件,它似乎具有签名配置:
...
$SigSet=1
$SigState=1
$SigSetValue=1
....
$tmpStrFilter=HTML File
$tmpSigPath=C:\Lotus\Notes\Data\FirmaCorreo\FirmaPedro.html
...
Notes 允许三种不同的邮件签名选项: 我想也许我只需要在每个客户端上编辑 notes.ini 来设置我的程序生成的 HTML 文件。 问题是,当我更改客户端上的签名类型时,notes.ini 没有改变。
有没有什么方法可以让生成的 HTML 文件成为 Lotus Notes 上的默认签名,而不要求每个用户进入“首选项”菜单并选择正确的设置? 我可以让我的 C# 程序为他们做这些吗?
【问题讨论】:
标签: c# html lotus-notes