using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int counter = 0;
string line;
// Read the file and display it line by line.
System.IO.StreamReader file =
new System.IO.StreamReader(\"c:\\\\temp\\\\SCW.mht\");
while ((line = file.ReadLine()) != null)
{
var jpgLoc = line.LastIndexOf(\".jpg\");
var gifLoc = line.LastIndexOf(\".gif\");
var pngLoc = line.LastIndexOf(\".png\");
var bmpLoc = line.LastIndexOf(\".bmp\");
var htmLoc = line.LastIndexOf(\".htm\");
var jsLoc = 0; // line.LastIndexOf(\".js\");
if ((jpgLoc > 0) || (gifLoc > 0) || (pngLoc > 0) || (bmpLoc > 0) || (htmLoc > 0) || (jsLoc > 0))
{
var dashLoc = line.LastIndexOf(\"_\");
var revSlashLoc = line.LastIndexOf(\"\\\\\");
var slashLoc = line.LastIndexOf(\"/\");
if (revSlashLoc > dashLoc) dashLoc = revSlashLoc;
if (slashLoc > dashLoc) dashLoc = slashLoc;
// var fileName = SST(line);
var fileName = line.Substring(dashLoc + 1);
if (fileName != null)
{
Console.WriteLine(fileName);
CreateEncodedFile(fileName, file);
Zane(fileName);
}
}
counter++;
Console.WriteLine(counter);
}
file.Close();
// Suspend the screen.
Console.ReadLine();
}
static void CreateEncodedFile(string filename, System.IO.StreamReader file)
{
int counter = 0;
string line;
System.IO.StreamWriter outfile = new System.IO.StreamWriter(\"c:\\\\temp\\\\Zipped\\\\\" + filename);
line = file.ReadLine();
line = \"xxx\";
while (line != \"\")
{
line = file.ReadLine();
// Console.WriteLine(line);
outfile.WriteLine(line);
}
outfile.Close();
}
// outfile
/* static string SST(string s)
{
int found = 0;
string zzz = \"\";
found = s.LastIndexOf(\"_\");
if (found > 0)
{
//Console.WriteLine(\"Found = \" + found + \" len = \" + s.Length);
zzz = s.Substring(found + 1);
//Console.WriteLine(\" {0}\", zzz);
}
return zzz;
}
*/
static void Zane(string filename)
{
string encodedString = System.IO.File.ReadAllText(\"C:\\\\Temp\\\\Zipped\\\\\" + filename);
byte[] data = Convert.FromBase64String(encodedString);
//string decodedString = Encoding.UTF8.GetString(data);
//string[] lines = { data };
System.IO.File.WriteAllBytes(\"c:\\\\temp\\\\unZipped\\\\\" + filename, data);
}
}
}
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"218","kudosSumWeight":0,"repliesCount":0,"postTime":"2017-02-26T16:41:39.964-08:00","lastPublishTime":"2017-02-26T16:41:39.964-08:00","metrics":{"__typename":"MessageMetrics","views":1436},"visibilityScope":"PUBLIC","placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"status":{"__typename":"IdeaStatus","previousStatus":null,"currentStatus":null},"replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"CachedAsset:text:en_US-components/users/UserLink-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/users/UserLink-1749759380271","value":{"authorName":"View Profile: {author}","anonymous":"Anonymous"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/users/UserRank-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserRank-1749759380271","value":{"rankName":"{rankName}","userRank":"Author rank {rankName}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageTime-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageTime-1749759380271","value":{"postTime":"Published: {time}","lastPublishTime":"Last Update: {time}","conversation.lastPostingActivityTime":"Last posting activity time: {time}","conversation.lastPostTime":"Last post time: {time}","moderationData.rejectTime":"Rejected time: {time}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageSubject-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageSubject-1749759380271","value":{"noSubject":"(no subject)"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageBody-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageBody-1749759380271","value":{"showMessageBody":"Show More","mentionsErrorTitle":"{mentionsType, select, board {Board} user {User} message {Message} other {}} No Longer Available","mentionsErrorMessage":"The {mentionsType} you are trying to view has been removed from the community.","videoProcessing":"Video is being processed. Please try again in a few minutes.","bannerTitle":"Video provider requires cookies to play the video. Accept to continue or {url} it directly on the provider's site.","buttonTitle":"Accept","urlText":"watch"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageCustomFields-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageCustomFields-1749759380271","value":{"CustomField.default.label":"Value of {name}"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/common/QueryHandler-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/common/QueryHandler-1749759380271","value":{"title":"Query Handler"},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageReplyButton-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageReplyButton-1749759380271","value":{"repliesCount":"{count}","title":"Reply","title@board:BLOG@message:root":"Comment","title@board:TKB@message:root":"Comment","title@board:IDEA@message:root":"Comment","title@board:OCCASION@message:root":"Comment"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1749759380271","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1749759380271","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/common/ExternalLinkWarningModal-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/common/ExternalLinkWarningModal-1749759380271","value":{"title":"Leaving the Community","description":"You're about to leave this site and navigate to an external domain. Are you sure you want to continue?","action.submit":"Continue","action.cancel":"Go Back"},"localOverride":false},"CachedAsset:text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/attachments/AttachmentView/AttachmentViewChip-1749759380271","value":{"errorTitle":"Failed!","previewFile":"Preview File","downloadFile":"Download File {name}","removeFile":"Remove File {name}","errorBadExtension":"This file does not have a valid extension. \"{extensions}\" are the valid extensions.","errorFileEmpty":"This file is empty or does not exist.","errorTooLarge":"The maximum file size is: {maxFileSize}.","errorTooMany":"Too many attachments. The maximum number of attachments per message is: {maxAttachmentCount, number, integer}.","errorDuplicate":"This file is already attached."},"localOverride":false},"CachedAsset:text:en_US-components/messages/MessageListMenu-1749759380271":{"__typename":"CachedAsset","id":"text:en_US-components/messages/MessageListMenu-1749759380271","value":{"postTimeAsc":"Oldest","postTimeDesc":"Newest","kudosSumWeightAsc":"Least Liked","kudosSumWeightDesc":"Most Liked","sortTitle":"Sort By","sortedBy.item":" { itemName, select, postTimeAsc {Oldest} postTimeDesc {Newest} kudosSumWeightAsc {Least Liked} kudosSumWeightDesc {Most Liked} other {}}"},"localOverride":false}}}},"page":"/ideas/IdeaMessagePage/IdeaMessagePage","query":{"boardId":"testxcompletefeaturerequests","messageSubject":"performance-graphs-visible-elsewhere-","messageId":"127533"},"buildId":"3XH0qYWYCnEYycuN5W4S8","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","surveysEnabled":true,"openTelemetry":{"clientEnabled":false,"configName":"smartbear","serviceVersion":"25.4.0","universe":"prod","collector":"http://localhost:4318","logLevel":"error","routeChangeAllowedTime":"5000","headers":"","enableDiagnostic":"false","maxAttributeValueLength":"4095"},"apolloDevToolsEnabled":false,"quiltLazyLoadThreshold":"3"},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["components_community_Navbar_NavbarWidget","components_community_Breadcrumb_BreadcrumbWidget","components_ideas_IdeaTopicWidget","components_customComponent_CustomComponent","components_messages_MessageView_MessageViewStandard","components_messages_ThreadedReplyList","shared_client_components_common_List_UnwrappedList","components_attachments_AttachmentView","components_attachments_AttachmentView_AttachmentViewChip","shared_client_components_common_List_UnstyledList","components_messages_MessageView","components_customComponent_CustomComponentContent_TemplateContent"],"appGip":true,"scriptLoader":[]}