Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a private tool for Log Analysis.
It is shared only with certain trained helpers on some forums.

The tool creates a script for another tool which can delete files or make reg changes and more.

In the past the script was in BBCode only.

But some forums (will) no longer support BBCode.

Last year I started tests to create the script in Html code.

Problem is when file names have blank characters:
C:\Program Files (x86)\Malwarebytes Premium 4.1.0 64  bit Silent.exe

Between '64' and 'bit' are two blanks, but when I use the Html string which still has the two blanks between '64' and 'bit', the webbrowser control shows only one blank between '64' and 'bit':
C:\Program Files (x86)\Malwarebytes Premium 4.1.0 64 bit Silent.exe

Same happens when I sent the Html string to the default browser of the pc.

What can I do to stop that issue?

What I have tried:

I checked the webbrowser properties for anything helpful but no success.
Searched the web.
Tried for two spaces
Posted
Updated 9-Feb-21 5:18am
Comments
Richard MacCutchan 9-Feb-21 10:20am    
It is not clear what you code is doing, or why you want to post this information to a web page.
Jo_vb.net 9-Feb-21 10:34am    
It is for malware removal.

The user who thinks his pc is infected takes a tool called FRST to create logs which include info about files, installed software, Autoruns and more.
These logs the user posts in a topic of a malware removal forum.
My tool can analyze those logs and create a script (which needs to be checked and improved by a trained helper).
Only trained helpers are allowed to create a script (manually or with my tool or both) and help the user to remove unwanted software or malware.

The helper posts this script in the topic of the user who thinks his pc is infected.
Most forum software accepts BBCode and/or formatted Html.

The user who wants to run the script on the FRST tool then copies the Html formatted script from the forum to the clipboard.

The – when the FRST tool starts – it pastes the script from the clipboard and executes it.

Richard MacCutchan 9-Feb-21 11:18am    
See below.

1 solution

It seems as though using <pre> tags preserves all spacing.
C:\Program Files (x86)\Malwarebytes Premium 4.1.0 64  bit Silent.exe
 
Share this answer
 
Comments
Jo_vb.net 9-Feb-21 12:15pm    
Using code tags would be the last ressort, if nothing else helps.

I would like to have a better way.
Richard MacCutchan 9-Feb-21 12:27pm    
Then do not use HTML.
Luc Pattyn 9-Feb-21 13:13pm    
All whitespace gets accumulated and replaced by a single space, that is a feature of HTML. There are four ways to avoid it:
1. use PRE tags as Richard pointed out
2. use &nbsp; instead of a space (i.e. modify the source)
3. don't use HTML
4. don't ever put two or more spaces in a filename (I tend to avoid any space in filenames!)

BTW: why would your tool need to use the result of HTML; the HTML source itself contains the double spaces, so parse that, using the HTMLutility pack or something similar.

:)
Jo_vb.net 9-Feb-21 18:27pm    
using & nbsp ; seems to be helpful for my issue and better then using code tags.

Jo_vb.net 9-Feb-21 12:36pm    
Sooner or later the malware removal forums will no longer support BBCode.

Therefore I will need to have the solution with Html.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900