我刚刚花了大约 4 个小时试图弄清楚如何以编程方式检索/设置 Microsoft Outlook 2010 的 Outlook 设置。我所说的“设置”是指文件/选项/邮件下的设置。我想做的是检索用户设置的设置列表,自动化我们每天需要在某些消息上运行的整个打印过程,然后恢复设置。到他们原来的。
我注意到在 Word 中,下面的代码可用于通过 Word.Application.Options 设置某些设置,但我在 Outlook 中找不到任何属性或方法来实现此目的。任何帮助都感激不尽。
Word.Application application = (Word.Application)initialiseApps(AppNames.Word);
Word.Options options = application.Options;
wordSettings.PrintDrawingObjects = options.PrintDrawingObjects;
wordSettings.PrintBackgrounds = options.PrintBackgrounds;
wordSettings.PrintProperties = options.PrintProperties;
wordSettings.PrintHiddenText = options.PrintHiddenText;
wordSettings.UpdateFieldsAtPrint = options.UpdateFieldsAtPrint;
wordSettings.PrintFieldCodes = options.PrintFieldCodes;
wordSettings.MapPaperSize = options.MapPaperSize;
application.Quit();
Marshal.ReleaseComObject(options);
Marshal.ReleaseComObject(application);
Run Code Online (Sandbox Code Playgroud) 我的办公室使用 Excel 准备数据,然后将其导入 SQL 数据库。但是,我们一直遇到以下错误。
当从一台计算机导入数据时,它会丢失所有前导零。但是,当从另一台计算机导入它时,它可以完美导入。
前导零的一个示例是我们的商品编号需要格式化为“001, 002, 003,... 010, 011, 012,... 100, 101, 102, ect”。
1)excel文件存储在服务器上,因此文件没有区别。2) 如果用户交换工作站,结果保留在计算机上,而不随用户一起切换。3) 数据格式为文本。它已从“数据”选项卡和“格式单元格”中格式化为文本。
Excel 中是否有特定于计算机而非电子表格的设置会影响数据导出?或者是否有非 Excel 特定设置会导致此问题?
我正在尝试读取 Akka 中的外部conf/属性文件。我指的是这篇文章
我只有一项配置,我需要在 myappConfiguration.properties 中添加更多属性。我可以看到属性文件能够加载但无法读取配置。
myappConfiguration.properties内容如下。
myconf {
directory : "D:\\Git\\Java_Test_WS\\file.reader\\"
}
Run Code Online (Sandbox Code Playgroud)
我收到以下异常,异常清楚地说明了一些类型问题,但我不明白我应该写什么。
Exception in thread "main" com.typesafe.config.ConfigException$WrongType: myappConfiguration.properties: myconf has type STRING rather than OBJECT
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:159)
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:145)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:172)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:258)
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:264)
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:37)
at com.myapp.file.reader.AkkaBaseEventReader.main(AkkaBaseEventReader.java:27)
Run Code Online (Sandbox Code Playgroud)
下面是我试图读取该配置条目的 Java 代码。我在第 27 行遇到异常,代码如下:
Config config = system.settings().config().getConfig("myconf.directory");
Run Code Online (Sandbox Code Playgroud)
完整代码:
public class AkkaBaseEventReader implements ApplicationConstant {
public static void main(String[] args) throws IOException {
System.setProperty("config.file","myappConfiguration.properties");
ActorSystem system = ActorSystemImpl.create("FileReaderForassignment");
final ActorRef reader = …Run Code Online (Sandbox Code Playgroud) 在 asp.net core 3.1 中,使用新的 System.Text.Json,我尝试在 appsettings 部分使用自定义 JsonConverter。手动序列化/反序列化尊重转换器就好了,但通过选项模式从 appSettings 读取则不然。这是我所拥有的:
Json转换器。为简单起见,这只是将字符串值转换为大写:
public class UpperConverter : JsonConverter<string>
{
public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
reader.GetString().ToUpper();
public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) =>
writer.WriteStringValue(value == null ? "" : value.ToUpper());
}
Run Code Online (Sandbox Code Playgroud)
appsettings 类,在字符串属性上声明转换器:
public class MyOptions
{
public const string Name = "MyOptions";
[JsonConverter(typeof(UpperConverter))]
public string MyString { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
Startup.cs 更改以准备所有内容:
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews()
.AddJsonOptions(options =>
{ …Run Code Online (Sandbox Code Playgroud) c# application-settings .net-core asp.net-core jsonconverter
我将 Angular 应用程序作为静态 Web 应用程序部署到 Azure 中。现在我想使用配置中的应用程序设置来更改环境中的变量。ts 来访问不同的 API 和 Application Insights,而无需每次都更改代码。
环境.ts
export const environment = {
production: true,
SERVER_API_URL: 'https://backend01.azurewebsites.net',
DEVELOPER_OPTIONS: true,
ENABLE_PROD_MODE: true,
appInsights: {
instrumentationKey: '<key>'
}
};
Run Code Online (Sandbox Code Playgroud)
我想改变instrumentationKey和SERVER_API_URL。这可以通过应用程序设置实现吗?有人知道如何做到这一点吗?
谢谢 :)
azure application-settings angular azure-static-web-app static-web-apps
要存储应用程序设置,我使用项目属性中的"设置"选项卡.在代码中,我写Settings.Default.FontSize = size;,然后Settings.Default.Save();
当我关闭应用程序并再次运行时,设置的新值应该在那里.是的,它在Windows上运行正常,在Windows上使用Mono 2.4,但在Linux上不使用Mono 2.4.它不会在Linux下保存任何东西.
你有线索吗?
问候,Petar
在项目的属性中,我创建了这样的设置
NumberOfUsers int User 10
Run Code Online (Sandbox Code Playgroud)
列是名称,类型,范围和值.
然后有一个ComboBox,用户可以在其中设置'NumberOfUsers'.此组合具有SelectedIndexChanged事件,每当用户更改组合的值时,我都会保存更改.这是代码:
Settings.Default.NumberOfUsers = combo1.SelectedIndex;
Settings.Default.Save();
Run Code Online (Sandbox Code Playgroud)
具有此组合的表单从父表单调用,frm.ShowDialog();并在子表单的构造函数中调用我尝试根据设置条目设置组合的选定索引
combo1.SelectedIndex = Settings.Default.NumberOfUsers;
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用,即组合不会从设置中提取值,而是默认为0作为选定索引.
谁知道我弄错了?
我正在用python编写应用程序(使用wxPython作为gui),我正在寻找一种独立于平台的方法来决定存储应用程序设置文件的位置.在linux系统上,通常存储应用程序设置文件的位置是什么?在Mac和Windows(所有现代版本)上怎么样?
理想情况下,我想要一个提供平台无关接口的模块来定位这些文件.这样的事情已经存在吗?
我正在写一个WP7(芒果)应用程序.我将值存储在WP7 IsolatedStorageSettings.ApplicationSettings中,然后我调用 IsolatedStorageSettings.ApplicationSettings.Save();
如果我按回去,离开屏幕,然后我回来,我可以很好地读取数值.但是,如果我在调试器中按重启(或者只是从模拟器重启),ApplicationSettings会抛出一个KeyNotFoundException,好像它没有持久 ...
我还没有在设备上试过它,我没有一个可用权利现在.
我可能做错了什么?
isolatedstorage application-settings windows-phone-7 windows-phone-7-emulator
在我的Azure应用服务中,我想更新应用程序设置,但在从VS发布后,密钥不会覆盖本地Web.config中的值
在结果中,我的azure上的web.config包含来自本地设置的值
<connectionStrings>
<add name="MainConnectionString" connectionString="ConnectionStringToReplaceByAzure" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="MS_SigningKey" value="Overridden by portal settings" />
</appSettings>
Run Code Online (Sandbox Code Playgroud) connection-string azure application-settings azure-web-sites