CHM help on network share won't open from application - winforms

I have a .NET WinForms application that uses CHM help file. Both executable and CHM are on a network share. I used http://www.helpandmanual.com/products_hhreg.html to create registry entries that could allow display of the help contents. If I open the file itself from the share all is OK. However, when I press F1 in my application to invoke help, I get the familiar "Navigation to the webpage was canceled" error. No matter what I do, including setting zone security level = 2 will help.
How do I go about using CHM help in my application when launched from a network share?

System.Diagnostics.Process.Start(path);
I found this other approach https://stackoverflow.com/a/928156/1757491 which seems to allow me to view the help but when I use
System.Windows.Forms.Help.ShowHelp(null, path);
I get what you describe.

Related

How to lock an exe file?

(Sorry in advance, if I have the wrong tags)
Hello!
So I am trying to work on a personal WPF project which would allow the client application exe to download another application exe (Unity Application) and open it within the client exe's Grid. Everything is working fine.
But, I am wondering if there's a way to "lock" the downloaded application in a way that only my client exe can open the downloaded exe?
Here's the only solution I have thought of but not sure with
Check for command line arguments within the Unity Applications
This works well but people who knows about the existence of decompiler might be able to decode that I am trying to check the arguments, and input relevant data there. :(. So, it won't help too much?
Thanks for any insights.
-Kevin
There is no non-hackable solution, you can only make it harder for crackers to break into the app by code obfuscation (hard to read the code) + adding integrity checks (make sure that your app is not modified).. There are commecial apps out there to do this (ex. PreEmptive), and their solutions differ from each other, nothing is ultimate.
Anyway, You might make Unity Application read some file or some registry value that Client application has updated just before launching the Unity Application, along with command line args method that you mentioned..

Serilog in UWP is not writing the log in D drive

I am using Serilog in my UWP application. I can write the log in App LocalState folder without any issue.
But now I want to write the logs in D: drive specific folder. I have added the broadFileSystemAccess restricted capability and enabled the full access from the settings.
But still it is not creating the file in the specified location and not raising any error.
Anyone know the fix for this? Thanks in advance.
var file = #"D:\Logs\Serilog.txt";
Serilog.Log.Logger = new LoggerConfiguration().WriteTo.File(file).CreateLogger();
There is a very important information about broadFileSystemAccess capability on the File access permissions document. I'm not sure if you note it.
This broadFileSystemAccess capability only works for APIs in the Windows.Storage namespace.
This point is very important. So, your issue actually is you need to check the LoggerConfiguration().WriteTo.File(file).CreateLogger() relevant method if it write to files by using the Windows.Storage APIs.
By my checking, it uses the StreamWriter method to write to files. But this method is not included in the Windows.Storage APIs. So, the issue was very obvious. You need to submit this issue to Github and let the officials to modify this method and make it work in UWP.
Or, if you're interested in serilog-sinks-file source code, you could download it and make the change by yourself, Then, you could compile a custom serilog library version for your UWP project.

Security message on Windows 10 magnet link

I'm working on a WPF/C# application who are exposing commands to be called called by magnet link.
Our application create registry key when msi in installed but, when we use the magnet link, we have a security message each time, even if we check allow access.
Does someone know how we can do to not have this message or at least, just the first time?
We can have dev solution, registry entry, gpo, ...
thanks by advance for any help.
Regards

Creating log file. Actionscript

Is there any other solution to create logging to file instead of using SharedObject ?
FileReference works only on Adobe air. File library isn't good because it opens dialog box.
I want to write error logs to file and now I'm using SharedObject, but that's not the main task of the SharedObject.
So if someone have any solutions, would be glad to hear it.
Maybe someone will be interesting - i solved this problem.
I wrote a simple WCF service which runs on the same computer. So i can send log messages to this server through localhost and the service writes the logs to the file.
The best part, that it doesn't require an internet connection. ;)

How to write files in C:\Windows\System32 with full permissions

Iam working on POS software using winforms. Iam trying to programmatically writing XML file (which contain some encrypted information about software serial number) to C:\Windows\System32 directory. But when i write i get an error Access denied.
Can anyone please explain how can i write this file with full permissions in this directory in windows 7 as well as in windows XP???
Any other suggestion or better way to do this will also be welcome.
Thanks in advance.
You'll need to be an administrator on the machine to write to the Windows directory. In addition, on Vista and later, your process will need to be "elevated" (otherwise known as Run As Administrator). You can configure this on your application's property sheet, as discussed here, or with a bit more work, do it programmatically.
It's bad practice to write to that directory, though, notwithstanding all the (misguided) software that does that. Save your files somewhere else. %appdata% or %localappdata% (directories specifically meant for application data) are good choices.

Resources