NativeProxy.cs 1000 B

123456789101112131415161718192021222324252627
  1. using System.Runtime.InteropServices;
  2. using System.Text;
  3. using Vinno.Infrastructure;
  4. using Vinno.Services.ServiceManagerImpl;
  5. namespace WingAIDiagnosisService.URMManage
  6. {
  7. public class NativeProxy
  8. {
  9. [DllImport("VCL.dll", CharSet = CharSet.Ansi, EntryPoint = "UpdateSection")]
  10. private static extern void UpdateSectionImpl(string section, string key, string value);
  11. [DllImport("VCL.dll", CharSet = CharSet.Ansi)]
  12. public static extern void GetValue(string section, string key, StringBuilder lpString, int maxCount);
  13. public static void UpdateSection(string section, string key, string value, bool logit = true)
  14. {
  15. Logger.ForceWriteLineIf(logit, "UpdateSection({0}.{1}: {2})", section, key, value);
  16. var resourceManager = (ResourceManagerImpl)ResourceManager.Manager;
  17. resourceManager.UpdateDefaultValue(section, key, value);
  18. UpdateSectionImpl(section, key, value);
  19. }
  20. }
  21. }