v2.0
This commit is contained in:
parent
ff20c7305f
commit
7b9f51ceb9
20
Snap2HTML.sln
Normal file
20
Snap2HTML.sln
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snap2HTML", "Snap2HTML\Snap2HTML.csproj", "{04CDFDC2-534E-443D-B75D-A7A0F19B4008}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{04CDFDC2-534E-443D-B75D-A7A0F19B4008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{04CDFDC2-534E-443D-B75D-A7A0F19B4008}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{04CDFDC2-534E-443D-B75D-A7A0F19B4008}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{04CDFDC2-534E-443D-B75D-A7A0F19B4008}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
246
Snap2HTML/CommandLine.cs
Normal file
246
Snap2HTML/CommandLine.cs
Normal file
@ -0,0 +1,246 @@
|
||||
// Source: http://jake.ginnivan.net/c-sharp-argument-parser/ (which is based on http://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser , MIT License)
|
||||
|
||||
/* Examples:
|
||||
|
||||
Argument: –flag
|
||||
Usage: args.IsTrue("flag");
|
||||
Result: true
|
||||
|
||||
Argument: –arg:MyValue
|
||||
//Usage: args.Single("arg");
|
||||
Result: MyValue
|
||||
|
||||
Argument: –arg "My Value"
|
||||
Usage: args.Single("arg");
|
||||
Result: ‘My Value’
|
||||
|
||||
Argument: /arg=Value /arg=Value2
|
||||
Usage: args["arg"]
|
||||
Result: new string[] {"Value", "Value2"}
|
||||
|
||||
Argument: /arg="Value,Value2"
|
||||
Usage: args["arg"]
|
||||
Result: new string[] {"Value", "Value2"}
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CommandLine.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Arguments class
|
||||
/// </summary>
|
||||
class Arguments
|
||||
{
|
||||
/// <summary>
|
||||
/// Splits the command line. When main(string[] args) is used escaped quotes (ie a path "c:\folder\")
|
||||
/// Will consume all the following command line arguments as the one argument.
|
||||
/// This function ignores escaped quotes making handling paths much easier.
|
||||
/// </summary>
|
||||
/// <param name="commandLine">The command line.</param>
|
||||
/// <returns></returns>
|
||||
public static string[] SplitCommandLine(string commandLine)
|
||||
{
|
||||
var translatedArguments = new StringBuilder(commandLine);
|
||||
var escaped = false;
|
||||
for (var i = 0; i < translatedArguments.Length; i++)
|
||||
{
|
||||
if (translatedArguments[i] == '"')
|
||||
{
|
||||
escaped = !escaped;
|
||||
}
|
||||
if (translatedArguments[i] == ' ' && !escaped)
|
||||
{
|
||||
translatedArguments[i] = '\n';
|
||||
}
|
||||
}
|
||||
|
||||
var toReturn = translatedArguments.ToString().Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
for (var i = 0; i < toReturn.Length; i++)
|
||||
{
|
||||
toReturn[i] = RemoveMatchingQuotes(toReturn[i]);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static string RemoveMatchingQuotes(string stringToTrim)
|
||||
{
|
||||
var firstQuoteIndex = stringToTrim.IndexOf('"');
|
||||
var lastQuoteIndex = stringToTrim.LastIndexOf('"');
|
||||
while (firstQuoteIndex != lastQuoteIndex)
|
||||
{
|
||||
stringToTrim = stringToTrim.Remove(firstQuoteIndex, 1);
|
||||
stringToTrim = stringToTrim.Remove(lastQuoteIndex - 1, 1); //-1 because we've shifted the indicies left by one
|
||||
firstQuoteIndex = stringToTrim.IndexOf('"');
|
||||
lastQuoteIndex = stringToTrim.LastIndexOf('"');
|
||||
}
|
||||
|
||||
return stringToTrim;
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, Collection<string>> _parameters;
|
||||
private string _waitingParameter;
|
||||
|
||||
public Arguments(IEnumerable<string> arguments)
|
||||
{
|
||||
_parameters = new Dictionary<string, Collection<string>>();
|
||||
|
||||
string[] parts;
|
||||
|
||||
//Splits on beginning of arguments ( - and -- and / )
|
||||
//And on assignment operators ( = and : )
|
||||
var argumentSplitter = new Regex(@"^-{1,2}|^/|=|:",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
foreach (var argument in arguments)
|
||||
{
|
||||
parts = argumentSplitter.Split(argument, 3);
|
||||
switch (parts.Length)
|
||||
{
|
||||
case 1:
|
||||
AddValueToWaitingArgument(parts[0]);
|
||||
break;
|
||||
case 2:
|
||||
AddWaitingArgumentAsFlag();
|
||||
|
||||
//Because of the split index 0 will be a empty string
|
||||
_waitingParameter = parts[1];
|
||||
break;
|
||||
case 3:
|
||||
AddWaitingArgumentAsFlag();
|
||||
|
||||
//Because of the split index 0 will be a empty string
|
||||
string valuesWithoutQuotes = RemoveMatchingQuotes(parts[2]);
|
||||
|
||||
AddListValues(parts[1], valuesWithoutQuotes.Split(','));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AddWaitingArgumentAsFlag();
|
||||
}
|
||||
|
||||
private void AddListValues(string argument, IEnumerable<string> values)
|
||||
{
|
||||
foreach (var listValue in values)
|
||||
{
|
||||
Add(argument, listValue);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddWaitingArgumentAsFlag()
|
||||
{
|
||||
if (_waitingParameter == null) return;
|
||||
|
||||
AddSingle(_waitingParameter, "true");
|
||||
_waitingParameter = null;
|
||||
}
|
||||
|
||||
private void AddValueToWaitingArgument(string value)
|
||||
{
|
||||
if (_waitingParameter == null) return;
|
||||
|
||||
value = RemoveMatchingQuotes(value);
|
||||
|
||||
Add(_waitingParameter, value);
|
||||
_waitingParameter = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the count.
|
||||
/// </summary>
|
||||
/// <value>The count.</value>
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _parameters.Count;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified argument.
|
||||
/// </summary>
|
||||
/// <param name="argument">The argument.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
public void Add(string argument, string value)
|
||||
{
|
||||
if (!_parameters.ContainsKey(argument))
|
||||
_parameters.Add(argument, new Collection<string>());
|
||||
|
||||
_parameters[argument].Add(value);
|
||||
}
|
||||
|
||||
public void AddSingle(string argument, string value)
|
||||
{
|
||||
if (!_parameters.ContainsKey(argument))
|
||||
_parameters.Add(argument, new Collection<string>());
|
||||
else
|
||||
throw new ArgumentException(string.Format("Argument {0} has already been defined", argument));
|
||||
|
||||
_parameters[argument].Add(value);
|
||||
}
|
||||
|
||||
public void Remove(string argument)
|
||||
{
|
||||
if (_parameters.ContainsKey(argument))
|
||||
_parameters.Remove(argument);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified argument is true.
|
||||
/// </summary>
|
||||
/// <param name="argument">The argument.</param>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the specified argument is true; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
public bool IsTrue(string argument)
|
||||
{
|
||||
AssertSingle(argument);
|
||||
|
||||
var arg = this[argument];
|
||||
|
||||
return arg != null && arg[0].Equals("true", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private void AssertSingle(string argument)
|
||||
{
|
||||
if (this[argument] != null && this[argument].Count > 1)
|
||||
throw new ArgumentException(string.Format("{0} has been specified more than once, expecting single value", argument));
|
||||
}
|
||||
|
||||
public string Single(string argument)
|
||||
{
|
||||
AssertSingle(argument);
|
||||
|
||||
//only return value if its NOT true, there is only a single item for that argument
|
||||
//and the argument is defined
|
||||
if (this[argument] != null && !IsTrue(argument))
|
||||
return this[argument][0];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool Exists(string argument)
|
||||
{
|
||||
return (this[argument] != null && this[argument].Count > 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="System.Collections.ObjectModel.Collection<T>"/> with the specified parameter.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public Collection<string> this[string parameter]
|
||||
{
|
||||
get
|
||||
{
|
||||
return _parameters.ContainsKey(parameter) ? _parameters[parameter] : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
201
Snap2HTML/PortableSettingsProvider.cs
Normal file
201
Snap2HTML/PortableSettingsProvider.cs
Normal file
@ -0,0 +1,201 @@
|
||||
// Source: http://www.codeproject.com/Articles/20917/Creating-a-Custom-Settings-Provider , License: The Code Project Open License (CPOL)
|
||||
// To use: For each setting in properties: Properties->Provider set to PortableSettingsProvider
|
||||
// If this does not compile: Project->Add Reference->.Net-> Doubleclick "System.Configuration"
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Configuration.Provider;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Specialized;
|
||||
using Microsoft.Win32;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
public class PortableSettingsProvider : SettingsProvider {
|
||||
|
||||
const string SETTINGSROOT = "Settings";
|
||||
//XML Root Node
|
||||
|
||||
public override void Initialize(string name, NameValueCollection col) {
|
||||
base.Initialize(this.ApplicationName, col);
|
||||
}
|
||||
|
||||
public override string ApplicationName {
|
||||
get {
|
||||
if (Application.ProductName.Trim().Length > 0) {
|
||||
return Application.ProductName;
|
||||
}
|
||||
else {
|
||||
FileInfo fi = new FileInfo(Application.ExecutablePath);
|
||||
return fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);
|
||||
}
|
||||
}
|
||||
set { }
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
public override string Name {
|
||||
get { return "PortableSettingsProvider"; }
|
||||
}
|
||||
public virtual string GetAppSettingsPath() {
|
||||
//Used to determine where to store the settings
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(Application.ExecutablePath);
|
||||
return fi.DirectoryName;
|
||||
}
|
||||
|
||||
public virtual string GetAppSettingsFilename() {
|
||||
//Used to determine the filename to store the settings
|
||||
return ApplicationName + ".settings";
|
||||
}
|
||||
|
||||
public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection propvals) {
|
||||
//Iterate through the settings to be stored
|
||||
//Only dirty settings are included in propvals, and only ones relevant to this provider
|
||||
foreach (SettingsPropertyValue propval in propvals) {
|
||||
SetValue(propval);
|
||||
}
|
||||
|
||||
try {
|
||||
SettingsXML.Save(Path.Combine(GetAppSettingsPath(), GetAppSettingsFilename()));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
}
|
||||
//Ignore if cant save, device been ejected
|
||||
}
|
||||
|
||||
public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection props) {
|
||||
//Create new collection of values
|
||||
SettingsPropertyValueCollection values = new SettingsPropertyValueCollection();
|
||||
|
||||
//Iterate through the settings to be retrieved
|
||||
foreach (SettingsProperty setting in props) {
|
||||
|
||||
SettingsPropertyValue value = new SettingsPropertyValue(setting);
|
||||
value.IsDirty = false;
|
||||
value.SerializedValue = GetValue(setting);
|
||||
values.Add(value);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
private XmlDocument _settingsXML = null;
|
||||
|
||||
private XmlDocument SettingsXML {
|
||||
get {
|
||||
//If we dont hold an xml document, try opening one.
|
||||
//If it doesnt exist then create a new one ready.
|
||||
if (_settingsXML == null) {
|
||||
_settingsXML = new XmlDocument();
|
||||
|
||||
try {
|
||||
_settingsXML.Load(Path.Combine(GetAppSettingsPath(), GetAppSettingsFilename()));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
//Create new document
|
||||
XmlDeclaration dec = _settingsXML.CreateXmlDeclaration("1.0", "utf-8", string.Empty);
|
||||
_settingsXML.AppendChild(dec);
|
||||
|
||||
XmlNode nodeRoot = default(XmlNode);
|
||||
|
||||
nodeRoot = _settingsXML.CreateNode(XmlNodeType.Element, SETTINGSROOT, "");
|
||||
_settingsXML.AppendChild(nodeRoot);
|
||||
}
|
||||
}
|
||||
|
||||
return _settingsXML;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetValue(SettingsProperty setting) {
|
||||
string ret = "";
|
||||
|
||||
try {
|
||||
if (IsRoaming(setting)) {
|
||||
ret = SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + setting.Name).InnerText;
|
||||
}
|
||||
else {
|
||||
ret = SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName + "/" + setting.Name).InnerText;
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception ex) {
|
||||
if ((setting.DefaultValue != null)) {
|
||||
ret = setting.DefaultValue.ToString();
|
||||
}
|
||||
else {
|
||||
ret = "";
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SetValue(SettingsPropertyValue propVal) {
|
||||
|
||||
XmlElement MachineNode = default(XmlElement);
|
||||
XmlElement SettingNode = default(XmlElement);
|
||||
|
||||
//Determine if the setting is roaming.
|
||||
//If roaming then the value is stored as an element under the root
|
||||
//Otherwise it is stored under a machine name node
|
||||
try {
|
||||
if (IsRoaming(propVal.Property)) {
|
||||
SettingNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + propVal.Name);
|
||||
}
|
||||
else {
|
||||
SettingNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName + "/" + propVal.Name);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
SettingNode = null;
|
||||
}
|
||||
|
||||
//Check to see if the node exists, if so then set its new value
|
||||
if ((SettingNode != null)) {
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
}
|
||||
else {
|
||||
if (IsRoaming(propVal.Property)) {
|
||||
//Store the value as an element of the Settings Root Node
|
||||
SettingNode = SettingsXML.CreateElement(propVal.Name);
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(SettingNode);
|
||||
}
|
||||
else {
|
||||
//Its machine specific, store as an element of the machine name node,
|
||||
//creating a new machine name node if one doesnt exist.
|
||||
try {
|
||||
|
||||
MachineNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
MachineNode = SettingsXML.CreateElement(Environment.MachineName);
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(MachineNode);
|
||||
}
|
||||
|
||||
if (MachineNode == null) {
|
||||
MachineNode = SettingsXML.CreateElement(Environment.MachineName);
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(MachineNode);
|
||||
}
|
||||
|
||||
SettingNode = SettingsXML.CreateElement(propVal.Name);
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
MachineNode.AppendChild(SettingNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsRoaming(SettingsProperty prop) {
|
||||
//Determine if the setting is marked as Roaming
|
||||
foreach (DictionaryEntry d in prop.Attributes) {
|
||||
Attribute a = (Attribute)d.Value;
|
||||
if (a is System.Configuration.SettingsManageabilityAttribute) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
20
Snap2HTML/Program.cs
Normal file
20
Snap2HTML/Program.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new frmMain());
|
||||
}
|
||||
}
|
||||
}
|
36
Snap2HTML/Properties/AssemblyInfo.cs
Normal file
36
Snap2HTML/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attr. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Snap2HTML")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("RL Vision")]
|
||||
[assembly: AssemblyProduct("Snap2HTML")]
|
||||
[assembly: AssemblyCopyright( "Copyright © RL Vision 2011-2017" )]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c2979ac5-80cf-4e5d-8365-5395115c30af")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion( "2.00.0.0" )]
|
||||
[assembly: AssemblyFileVersion( "2.00.0.0" )]
|
63
Snap2HTML/Properties/Resources.Designer.cs
generated
Normal file
63
Snap2HTML/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Snap2HTML.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Snap2HTML.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
Snap2HTML/Properties/Resources.resx
Normal file
117
Snap2HTML/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
148
Snap2HTML/Properties/Settings.Designer.cs
generated
Normal file
148
Snap2HTML/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,148 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Snap2HTML.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||
public string txtRoot {
|
||||
get {
|
||||
return ((string)(this["txtRoot"]));
|
||||
}
|
||||
set {
|
||||
this["txtRoot"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||
public bool chkHidden {
|
||||
get {
|
||||
return ((bool)(this["chkHidden"]));
|
||||
}
|
||||
set {
|
||||
this["chkHidden"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||
public bool chkSystem {
|
||||
get {
|
||||
return ((bool)(this["chkSystem"]));
|
||||
}
|
||||
set {
|
||||
this["chkSystem"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||
public bool chkLinkFiles {
|
||||
get {
|
||||
return ((bool)(this["chkLinkFiles"]));
|
||||
}
|
||||
set {
|
||||
this["chkLinkFiles"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||
public string txtLinkRoot {
|
||||
get {
|
||||
return ((string)(this["txtLinkRoot"]));
|
||||
}
|
||||
set {
|
||||
this["txtLinkRoot"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
|
||||
public bool chkOpenOutput {
|
||||
get {
|
||||
return ((bool)(this["chkOpenOutput"]));
|
||||
}
|
||||
set {
|
||||
this["chkOpenOutput"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
|
||||
public int WindowLeft {
|
||||
get {
|
||||
return ((int)(this["WindowLeft"]));
|
||||
}
|
||||
set {
|
||||
this["WindowLeft"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
|
||||
public int WindowTop {
|
||||
get {
|
||||
return ((int)(this["WindowTop"]));
|
||||
}
|
||||
set {
|
||||
this["WindowTop"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string txtTitle {
|
||||
get {
|
||||
return ((string)(this["txtTitle"]));
|
||||
}
|
||||
set {
|
||||
this["txtTitle"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
33
Snap2HTML/Properties/Settings.settings
Normal file
33
Snap2HTML/Properties/Settings.settings
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Snap2HTML.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="txtRoot" Provider="PortableSettingsProvider" Roaming="true" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="chkHidden" Provider="PortableSettingsProvider" Roaming="true" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="chkSystem" Provider="PortableSettingsProvider" Roaming="true" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="chkLinkFiles" Provider="PortableSettingsProvider" Roaming="true" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="txtLinkRoot" Provider="PortableSettingsProvider" Roaming="true" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="chkOpenOutput" Provider="PortableSettingsProvider" Roaming="true" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="WindowLeft" Provider="PortableSettingsProvider" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">-1</Value>
|
||||
</Setting>
|
||||
<Setting Name="WindowTop" Provider="PortableSettingsProvider" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">-1</Value>
|
||||
</Setting>
|
||||
<Setting Name="txtTitle" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
26
Snap2HTML/Properties/app.manifest
Normal file
26
Snap2HTML/Properties/app.manifest
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
<applicationRequestMinimum>
|
||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
|
||||
</applicationRequestMinimum>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</asmv1:assembly>
|
217
Snap2HTML/ReadMe.txt
Normal file
217
Snap2HTML/ReadMe.txt
Normal file
@ -0,0 +1,217 @@
|
||||
|
||||
--- Snap2HTML ----------------------------------------------------------------
|
||||
|
||||
Freeware by RL Vision (c) 2011-2017
|
||||
Homepage: http://www.rlvision.com
|
||||
|
||||
Portable:
|
||||
- Just unzip and run
|
||||
- Settings are saved in the application folder
|
||||
|
||||
Free Open Source Software:
|
||||
- Source code available at GitHub: https://github.com/rlv-dan
|
||||
|
||||
|
||||
--- About --------------------------------------------------------------------
|
||||
|
||||
This application takes a "snapshot" of the folder structure on your
|
||||
harddrive and saves it as an HTML file. What's unique about Snap2HTML is
|
||||
that the HTML file uses modern techniques to make it feel like a "real"
|
||||
application, displaying a treeview with folders that you can navigate to
|
||||
view the files contained within. There is also a built in file search and
|
||||
ability to export data as plain text, csv or json. Still, everything is
|
||||
contained in a single HTML file that you can easily store or distribute.
|
||||
|
||||
Exported file listings can be used in many ways. One is as a complement
|
||||
to your backups (note however that this program does not backup your
|
||||
files! It only creates a list of the files and directories). You can
|
||||
also keep a file list of e.g. external HDDs and other computers, in case
|
||||
you need to look something up or to save for historic reasons and
|
||||
documentation. When helping your friends with their computer problems
|
||||
you can ask them to send a snapshot of their folders so you can better
|
||||
understand their problem. It's really up to you to decide what Snap2HTML
|
||||
can be used for!
|
||||
|
||||
|
||||
--- Search -------------------------------------------------------------------
|
||||
|
||||
The built in search box accepts the following modifiers:
|
||||
|
||||
Wildcards * and ? can be used. * matches zero or more characters. ? matches
|
||||
exactly one character.
|
||||
|
||||
Prefix your search with > to search only the current folder. >> searches
|
||||
the current folder and its sub folders.
|
||||
|
||||
Tip: Search for * to list all files. This is especially useful together with
|
||||
the export functionality to get all data out of the html file.
|
||||
|
||||
|
||||
--- Linking Files ------------------------------------------------------------
|
||||
|
||||
Linking allows you open the listed files directly in your web browser.
|
||||
This is designed to be flexible, which also sometimes makes it tricky
|
||||
to get right. Here are some examples that shows how to use it:
|
||||
|
||||
-> Link to fully qualified local path
|
||||
Root folder: "c:\my_root\"
|
||||
Link to: "c:\my_root\"
|
||||
Use snapshot from: [anywhere locally]
|
||||
|
||||
-> Link to relative local path
|
||||
Root folder: "c:\my_root\"
|
||||
Link to: "my_root\"
|
||||
Use snapshot from: "c:\snapshot.html"
|
||||
|
||||
-> Link to same folder as snapshot is saved in
|
||||
Root folder: "c:\my_root\"
|
||||
Link to: [leave textbox empty]
|
||||
Use snapshot from: "c:\my_root\snapshot.html"
|
||||
|
||||
-> Link to a web server with mirror of local folder
|
||||
Root folder: "c:\my_www_root\"
|
||||
Link to: "http://www.example.com/"
|
||||
Use snapshot from: [anywhere]
|
||||
|
||||
-> Link to a relative path on a web server with mirror of local folder
|
||||
Root folder: "c:\my_www_root\subfolder"
|
||||
Link to: "subfolder/"
|
||||
Use snapshot from: "http://www.example.com/snapshot.html"
|
||||
|
||||
Notes:
|
||||
|
||||
Only files can be linked. Folders are automatically linked to browse the
|
||||
path in the snapshot.
|
||||
|
||||
Different browsers handle local links in different ways, usually for
|
||||
security reasons. For example, Internet Explorer will not let you open
|
||||
links to files on your local machine at all. (You can however copy the
|
||||
link and paste into the location field.)
|
||||
|
||||
|
||||
--- Command Line -------------------------------------------------------------
|
||||
|
||||
You can automate Snap2HTML by starting it from the command line with the
|
||||
following options:
|
||||
|
||||
Simple: Snap2HTMl.exe "c:\path\to\root\folder"
|
||||
|
||||
Starts the program with the given root path already set
|
||||
|
||||
|
||||
Full: Snap2HTMl.exe [-path:"root folder path"] [-outfile:"filename"]
|
||||
[-link:"link to path"] [-title:"page title"]
|
||||
[-hidden] [-system]
|
||||
|
||||
-path:"root folder path" - The root path to load.
|
||||
Example: -path:"c:\temp"
|
||||
|
||||
-outfile:"filename" - The filename to save the snapshot as.
|
||||
Don't forget the html extension!
|
||||
Example: -outfile:"c:\temp\out.html"
|
||||
|
||||
-link:"link to path" - The path to link files to.
|
||||
Example: -link:"c:\temp"
|
||||
|
||||
-title:"page title" - Set the page title
|
||||
|
||||
-hidden - Include hidden items
|
||||
|
||||
-system - Include system items
|
||||
|
||||
|
||||
Notes: Using -path and -outfile will cause the program to automatically
|
||||
start generating the snapshot, and quit when done!
|
||||
|
||||
Always surround paths and filenames with quotes ("")!
|
||||
|
||||
Do not include the [sqaure brackets] when you write your command
|
||||
line. (Sqaure brackets signify optional command line parameters)
|
||||
|
||||
|
||||
--- Template Design ---------------------------------------------------------
|
||||
|
||||
If you know html and javascript you may want to have a look at the file
|
||||
"template.html" in the application folder. This is the base for the
|
||||
output, and you can modify it with your own enhancements and design changes.
|
||||
If you make something nice you are welcome, to send it to me and I might
|
||||
distribute it with future versions of the program!
|
||||
|
||||
|
||||
--- Known Problems ----------------------------------------------------------
|
||||
|
||||
The finished HTML file contains embedded javascript. Web browsers (especially
|
||||
Internet Explorer) may limit execution of scripts as a security measure.
|
||||
If the page is stuck on "loading..." (with no cpu activity - large files may
|
||||
take a while to load) this is probably your problem.
|
||||
|
||||
One user reported needing to start Snap2HTML with "Run as Administrator"
|
||||
on Win7 Basic, otherwise it would hang when clicking on the browse for
|
||||
folders button.
|
||||
|
||||
Internet Explorer may fail to load very large files. The problems seems
|
||||
to be a hard limit in some versions of IE. I have seen this problem in
|
||||
IE11 myself. Being a hard limit there is no easy solution right now.
|
||||
|
||||
Large file tables can be slow to render and appear to have hung the
|
||||
browser, especially in Internet Explorer. The same can happen when
|
||||
navigating away from such a large folder and freeing the memory.
|
||||
|
||||
|
||||
--- Version History ---------------------------------------------------------
|
||||
|
||||
v1.0 (2011-07-25)
|
||||
Initial release
|
||||
|
||||
v1.1 (2011-08-11)
|
||||
Added tooltips when hovering folders
|
||||
Bugfixes
|
||||
|
||||
v1.2 (2011-08-18)
|
||||
Fixed some folder sorting problems
|
||||
Better error handling when permissions do not allow reading
|
||||
|
||||
v1.5 (2012-06-18)
|
||||
Added command line support
|
||||
Files can now be linked to a target of your choice
|
||||
Option to automatically open snapshots when generated
|
||||
Several bugfixes and tweaks
|
||||
|
||||
v1.51 (2012-07-11)
|
||||
Improved error handling
|
||||
|
||||
v1.9 (2013-07-24)
|
||||
Major overhaul of HTML template
|
||||
MUCH faster HTML loading
|
||||
Reduced HTML size by about 1/3
|
||||
Folders are now also displayed in the HTML file list
|
||||
Added option to set page title
|
||||
Application now saves it settings (in application folder)
|
||||
GUI enhancements: Drag & Drop a source folder, tooltips
|
||||
Many smaller fixes to both application and HTML
|
||||
|
||||
v1.91 (2013-12-29)
|
||||
Smaller change to hide root folder when linking files
|
||||
|
||||
v1.92 (2014-06-12)
|
||||
Fixed various bugs reported by users lately
|
||||
Slight changes to the internals of the template file
|
||||
|
||||
v2.0 (2017-04-22)
|
||||
Added export functionality to get data "out" of the HTML
|
||||
Export data as plain text, CSV or JSON
|
||||
Added support for searching with wildcards
|
||||
Search can be limited to current folder and/or subfolders
|
||||
Breadcrumb path is now clickable
|
||||
Current path is tracked in URL. Copy URL to link directly to that folder
|
||||
Opens previous folder when going back after opening a linked file
|
||||
Data format was tweaked to give slightly smaller output
|
||||
Fixed some bugs concerning filenames with odd characters
|
||||
Many other tweaks and fixes to improve the HTML template
|
||||
|
||||
|
||||
--- End User License Agreement -----------------------------------------------
|
||||
|
||||
RL Vision can not be held responsible for any damages whatsoever, direct or
|
||||
indirect, caused by this software or other material from RL Vision.
|
||||
|
36
Snap2HTML/Settings.cs
Normal file
36
Snap2HTML/Settings.cs
Normal file
@ -0,0 +1,36 @@
|
||||
namespace Snap2HTML.Properties {
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
internal sealed partial class Settings
|
||||
{
|
||||
public Settings()
|
||||
{
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
|
||||
this.SettingsLoaded += this.SettingsLoadedEventHandler;
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler( object sender, System.Configuration.SettingChangingEventArgs e )
|
||||
{
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler( object sender, System.ComponentModel.CancelEventArgs e )
|
||||
{
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
System.Console.WriteLine( "Settings Saving..." );
|
||||
}
|
||||
private void SettingsLoadedEventHandler( object sender, System.Configuration.SettingsLoadedEventArgs e )
|
||||
{
|
||||
System.Console.WriteLine( "Settings Loaded..." );
|
||||
}
|
||||
}
|
||||
}
|
158
Snap2HTML/Snap2HTML.csproj
Normal file
158
Snap2HTML/Snap2HTML.csproj
Normal file
@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{04CDFDC2-534E-443D-B75D-A7A0F19B4008}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Snap2HTML</RootNamespace>
|
||||
<AssemblyName>Snap2HTML</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<ManifestCertificateThumbprint>D8530038F9FC8EE4BB4C9837D304D5D55CC6D2C3</ManifestCertificateThumbprint>
|
||||
<ManifestKeyFile>DirLister_TemporaryKey.pfx</ManifestKeyFile>
|
||||
<GenerateManifests>false</GenerateManifests>
|
||||
<TargetZone>LocalIntranet</TargetZone>
|
||||
<SignManifests>false</SignManifests>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>0.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CommandLine.cs" />
|
||||
<Compile Include="frmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.Designer.cs">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMain_BackgroundWorker.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMain_Helpers.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PortableSettingsProvider.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<EmbeddedResource Include="frmMain.resx">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\app.manifest" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="icon.ico" />
|
||||
<Content Include="ReadMe.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="template.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
39
Snap2HTML/app.config
Normal file
39
Snap2HTML/app.config
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Snap2HTML.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
<Snap2HTML.Properties.Settings>
|
||||
<setting name="txtRoot" serializeAs="String">
|
||||
<value/>
|
||||
</setting>
|
||||
<setting name="chkHidden" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="chkSystem" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="chkLinkFiles" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="txtLinkRoot" serializeAs="String">
|
||||
<value/>
|
||||
</setting>
|
||||
<setting name="chkOpenOutput" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="WindowLeft" serializeAs="String">
|
||||
<value>-1</value>
|
||||
</setting>
|
||||
<setting name="WindowTop" serializeAs="String">
|
||||
<value>-1</value>
|
||||
</setting>
|
||||
<setting name="txtTitle" serializeAs="String">
|
||||
<value/>
|
||||
</setting>
|
||||
</Snap2HTML.Properties.Settings>
|
||||
</userSettings>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
623
Snap2HTML/frmMain.Designer.cs
generated
Normal file
623
Snap2HTML/frmMain.Designer.cs
generated
Normal file
@ -0,0 +1,623 @@
|
||||
namespace Snap2HTML
|
||||
{
|
||||
partial class frmMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtTitle = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.chkOpenOutput = new System.Windows.Forms.CheckBox();
|
||||
this.txtLinkRoot = new System.Windows.Forms.TextBox();
|
||||
this.chkLinkFiles = new System.Windows.Forms.CheckBox();
|
||||
this.chkHidden = new System.Windows.Forms.CheckBox();
|
||||
this.chkSystem = new System.Windows.Forms.CheckBox();
|
||||
this.cmdCreate = new System.Windows.Forms.Button();
|
||||
this.txtRoot = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.cmdBrowse = new System.Windows.Forms.Button();
|
||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||
this.linkLabel5 = new System.Windows.Forms.LinkLabel();
|
||||
this.linkLabel4 = new System.Windows.Forms.LinkLabel();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.pictureBox4 = new System.Windows.Forms.PictureBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.groupBoxMoreApps = new System.Windows.Forms.GroupBox();
|
||||
this.label33 = new System.Windows.Forms.Label();
|
||||
this.label32 = new System.Windows.Forms.Label();
|
||||
this.linkLabel3 = new System.Windows.Forms.LinkLabel();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.pictureBox3 = new System.Windows.Forms.PictureBox();
|
||||
this.pictureBox2 = new System.Windows.Forms.PictureBox();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.labelVersion = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||
this.backgroundWorker = new System.ComponentModel.BackgroundWorker();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.groupBoxMoreApps.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 351);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(354, 22);
|
||||
this.statusStrip1.SizingGrip = false;
|
||||
this.statusStrip1.TabIndex = 3;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// toolStripStatusLabel1
|
||||
//
|
||||
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
|
||||
this.toolStripStatusLabel1.Size = new System.Drawing.Size(153, 17);
|
||||
this.toolStripStatusLabel1.Text = "Select a root folder to begin...";
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.tabPage1);
|
||||
this.tabControl1.Controls.Add(this.tabPage3);
|
||||
this.tabControl1.Controls.Add(this.tabPage2);
|
||||
this.tabControl1.Location = new System.Drawing.Point(8, 8);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(338, 336);
|
||||
this.tabControl1.TabIndex = 0;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.label2);
|
||||
this.tabPage1.Controls.Add(this.txtTitle);
|
||||
this.tabPage1.Controls.Add(this.label6);
|
||||
this.tabPage1.Controls.Add(this.chkOpenOutput);
|
||||
this.tabPage1.Controls.Add(this.txtLinkRoot);
|
||||
this.tabPage1.Controls.Add(this.chkLinkFiles);
|
||||
this.tabPage1.Controls.Add(this.chkHidden);
|
||||
this.tabPage1.Controls.Add(this.chkSystem);
|
||||
this.tabPage1.Controls.Add(this.cmdCreate);
|
||||
this.tabPage1.Controls.Add(this.txtRoot);
|
||||
this.tabPage1.Controls.Add(this.label1);
|
||||
this.tabPage1.Controls.Add(this.cmdBrowse);
|
||||
this.tabPage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(330, 310);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Snapshot";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(6, 108);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(54, 13);
|
||||
this.label2.TabIndex = 18;
|
||||
this.label2.Text = "Page title:";
|
||||
//
|
||||
// txtTitle
|
||||
//
|
||||
this.txtTitle.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Snap2HTML.Properties.Settings.Default, "txtTitle", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.txtTitle.Location = new System.Drawing.Point(20, 126);
|
||||
this.txtTitle.Name = "txtTitle";
|
||||
this.txtTitle.Size = new System.Drawing.Size(300, 20);
|
||||
this.txtTitle.TabIndex = 4;
|
||||
this.txtTitle.Text = global::Snap2HTML.Properties.Settings.Default.txtTitle;
|
||||
this.toolTip1.SetToolTip(this.txtTitle, "Set the html page title");
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(6, 159);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(51, 13);
|
||||
this.label6.TabIndex = 16;
|
||||
this.label6.Text = "Link files:";
|
||||
//
|
||||
// chkOpenOutput
|
||||
//
|
||||
this.chkOpenOutput.AutoSize = true;
|
||||
this.chkOpenOutput.Checked = global::Snap2HTML.Properties.Settings.Default.chkOpenOutput;
|
||||
this.chkOpenOutput.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Snap2HTML.Properties.Settings.Default, "chkOpenOutput", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.chkOpenOutput.Location = new System.Drawing.Point(160, 285);
|
||||
this.chkOpenOutput.Name = "chkOpenOutput";
|
||||
this.chkOpenOutput.Size = new System.Drawing.Size(161, 17);
|
||||
this.chkOpenOutput.TabIndex = 18;
|
||||
this.chkOpenOutput.Text = "Open in browser when ready";
|
||||
this.chkOpenOutput.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtLinkRoot
|
||||
//
|
||||
this.txtLinkRoot.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Snap2HTML.Properties.Settings.Default, "txtLinkRoot", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.txtLinkRoot.Location = new System.Drawing.Point(20, 198);
|
||||
this.txtLinkRoot.Name = "txtLinkRoot";
|
||||
this.txtLinkRoot.Size = new System.Drawing.Size(300, 20);
|
||||
this.txtLinkRoot.TabIndex = 6;
|
||||
this.txtLinkRoot.Text = global::Snap2HTML.Properties.Settings.Default.txtLinkRoot;
|
||||
this.toolTip1.SetToolTip(this.txtLinkRoot, "This is the target files will be linked to. See ReadMe.txt for examples of how to" +
|
||||
" make links");
|
||||
//
|
||||
// chkLinkFiles
|
||||
//
|
||||
this.chkLinkFiles.AutoSize = true;
|
||||
this.chkLinkFiles.Checked = global::Snap2HTML.Properties.Settings.Default.chkLinkFiles;
|
||||
this.chkLinkFiles.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Snap2HTML.Properties.Settings.Default, "chkLinkFiles", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.chkLinkFiles.Location = new System.Drawing.Point(20, 177);
|
||||
this.chkLinkFiles.Name = "chkLinkFiles";
|
||||
this.chkLinkFiles.Size = new System.Drawing.Size(59, 17);
|
||||
this.chkLinkFiles.TabIndex = 5;
|
||||
this.chkLinkFiles.Text = "Enable";
|
||||
this.toolTip1.SetToolTip(this.chkLinkFiles, "Files can be linked so you can open them from within the html document");
|
||||
this.chkLinkFiles.UseVisualStyleBackColor = true;
|
||||
this.chkLinkFiles.CheckedChanged += new System.EventHandler(this.chkLinkFiles_CheckedChanged);
|
||||
//
|
||||
// chkHidden
|
||||
//
|
||||
this.chkHidden.AutoSize = true;
|
||||
this.chkHidden.Checked = global::Snap2HTML.Properties.Settings.Default.chkHidden;
|
||||
this.chkHidden.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Snap2HTML.Properties.Settings.Default, "chkHidden", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.chkHidden.Location = new System.Drawing.Point(20, 56);
|
||||
this.chkHidden.Name = "chkHidden";
|
||||
this.chkHidden.Size = new System.Drawing.Size(123, 17);
|
||||
this.chkHidden.TabIndex = 2;
|
||||
this.chkHidden.Text = "Include hidden items";
|
||||
this.toolTip1.SetToolTip(this.chkHidden, "This applies to both files and folders");
|
||||
this.chkHidden.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkSystem
|
||||
//
|
||||
this.chkSystem.AutoSize = true;
|
||||
this.chkSystem.Checked = global::Snap2HTML.Properties.Settings.Default.chkSystem;
|
||||
this.chkSystem.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Snap2HTML.Properties.Settings.Default, "chkSystem", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.chkSystem.Location = new System.Drawing.Point(20, 79);
|
||||
this.chkSystem.Name = "chkSystem";
|
||||
this.chkSystem.Size = new System.Drawing.Size(123, 17);
|
||||
this.chkSystem.TabIndex = 3;
|
||||
this.chkSystem.Text = "Include system items";
|
||||
this.toolTip1.SetToolTip(this.chkSystem, "This applies to both files and folders");
|
||||
this.chkSystem.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cmdCreate
|
||||
//
|
||||
this.cmdCreate.Enabled = false;
|
||||
this.cmdCreate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.cmdCreate.Image = ((System.Drawing.Image)(resources.GetObject("cmdCreate.Image")));
|
||||
this.cmdCreate.Location = new System.Drawing.Point(160, 239);
|
||||
this.cmdCreate.Name = "cmdCreate";
|
||||
this.cmdCreate.Size = new System.Drawing.Size(160, 40);
|
||||
this.cmdCreate.TabIndex = 7;
|
||||
this.cmdCreate.Text = " Create Snapshot";
|
||||
this.cmdCreate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
this.cmdCreate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
|
||||
this.cmdCreate.UseVisualStyleBackColor = true;
|
||||
this.cmdCreate.Click += new System.EventHandler(this.cmdCreate_Click);
|
||||
//
|
||||
// txtRoot
|
||||
//
|
||||
this.txtRoot.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::Snap2HTML.Properties.Settings.Default, "txtRoot", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
|
||||
this.txtRoot.Location = new System.Drawing.Point(20, 30);
|
||||
this.txtRoot.Name = "txtRoot";
|
||||
this.txtRoot.ReadOnly = true;
|
||||
this.txtRoot.Size = new System.Drawing.Size(266, 20);
|
||||
this.txtRoot.TabIndex = 0;
|
||||
this.txtRoot.Text = global::Snap2HTML.Properties.Settings.Default.txtRoot;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(6, 12);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(62, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Root folder:";
|
||||
//
|
||||
// cmdBrowse
|
||||
//
|
||||
this.cmdBrowse.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.cmdBrowse.Image = ((System.Drawing.Image)(resources.GetObject("cmdBrowse.Image")));
|
||||
this.cmdBrowse.Location = new System.Drawing.Point(292, 25);
|
||||
this.cmdBrowse.Name = "cmdBrowse";
|
||||
this.cmdBrowse.Padding = new System.Windows.Forms.Padding(2);
|
||||
this.cmdBrowse.Size = new System.Drawing.Size(28, 28);
|
||||
this.cmdBrowse.TabIndex = 1;
|
||||
this.toolTip1.SetToolTip(this.cmdBrowse, "Browse for root folder");
|
||||
this.cmdBrowse.UseVisualStyleBackColor = true;
|
||||
this.cmdBrowse.Click += new System.EventHandler(this.cmdBrowse_Click);
|
||||
//
|
||||
// tabPage3
|
||||
//
|
||||
this.tabPage3.Controls.Add(this.linkLabel5);
|
||||
this.tabPage3.Controls.Add(this.linkLabel4);
|
||||
this.tabPage3.Controls.Add(this.label8);
|
||||
this.tabPage3.Controls.Add(this.label7);
|
||||
this.tabPage3.Controls.Add(this.pictureBox4);
|
||||
this.tabPage3.Controls.Add(this.label4);
|
||||
this.tabPage3.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage3.Name = "tabPage3";
|
||||
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage3.Size = new System.Drawing.Size(330, 310);
|
||||
this.tabPage3.TabIndex = 2;
|
||||
this.tabPage3.Text = "Custom Design";
|
||||
this.tabPage3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// linkLabel5
|
||||
//
|
||||
this.linkLabel5.AutoSize = true;
|
||||
this.linkLabel5.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel5.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel5.Location = new System.Drawing.Point(17, 191);
|
||||
this.linkLabel5.Name = "linkLabel5";
|
||||
this.linkLabel5.Size = new System.Drawing.Size(99, 13);
|
||||
this.linkLabel5.TabIndex = 7;
|
||||
this.linkLabel5.TabStop = true;
|
||||
this.linkLabel5.Text = "Open contact page";
|
||||
this.linkLabel5.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel5_LinkClicked);
|
||||
//
|
||||
// linkLabel4
|
||||
//
|
||||
this.linkLabel4.AutoSize = true;
|
||||
this.linkLabel4.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel4.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel4.Location = new System.Drawing.Point(17, 112);
|
||||
this.linkLabel4.Name = "linkLabel4";
|
||||
this.linkLabel4.Size = new System.Drawing.Size(151, 13);
|
||||
this.linkLabel4.TabIndex = 4;
|
||||
this.linkLabel4.TabStop = true;
|
||||
this.linkLabel4.Text = "Open template.html in notepad";
|
||||
this.linkLabel4.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.Location = new System.Drawing.Point(17, 80);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(285, 33);
|
||||
this.label8.TabIndex = 8;
|
||||
this.label8.Text = "If you know some html/css you can modify the template yourself to better suit you" +
|
||||
"r needs:";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.Location = new System.Drawing.Point(17, 146);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(151, 49);
|
||||
this.label7.TabIndex = 6;
|
||||
this.label7.Text = "You are also welcome to contact me and I can help you for a small compensation:";
|
||||
//
|
||||
// pictureBox4
|
||||
//
|
||||
this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image")));
|
||||
this.pictureBox4.Location = new System.Drawing.Point(174, 143);
|
||||
this.pictureBox4.Name = "pictureBox4";
|
||||
this.pictureBox4.Size = new System.Drawing.Size(128, 128);
|
||||
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBox4.TabIndex = 5;
|
||||
this.pictureBox4.TabStop = false;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Location = new System.Drawing.Point(17, 21);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(307, 73);
|
||||
this.label4.TabIndex = 0;
|
||||
this.label4.Text = "Did you know that it is possible to change the appearance of the generated html f" +
|
||||
"ile? For example you might want to change the logo and colors to match your comp" +
|
||||
"any\'s.";
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.groupBoxMoreApps);
|
||||
this.tabPage2.Controls.Add(this.pictureBox1);
|
||||
this.tabPage2.Controls.Add(this.linkLabel1);
|
||||
this.tabPage2.Controls.Add(this.label5);
|
||||
this.tabPage2.Controls.Add(this.labelVersion);
|
||||
this.tabPage2.Controls.Add(this.label3);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(330, 310);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "About";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBoxMoreApps
|
||||
//
|
||||
this.groupBoxMoreApps.Controls.Add(this.label33);
|
||||
this.groupBoxMoreApps.Controls.Add(this.label32);
|
||||
this.groupBoxMoreApps.Controls.Add(this.linkLabel3);
|
||||
this.groupBoxMoreApps.Controls.Add(this.label17);
|
||||
this.groupBoxMoreApps.Controls.Add(this.linkLabel2);
|
||||
this.groupBoxMoreApps.Controls.Add(this.label11);
|
||||
this.groupBoxMoreApps.Controls.Add(this.pictureBox3);
|
||||
this.groupBoxMoreApps.Controls.Add(this.pictureBox2);
|
||||
this.groupBoxMoreApps.Location = new System.Drawing.Point(6, 174);
|
||||
this.groupBoxMoreApps.Name = "groupBoxMoreApps";
|
||||
this.groupBoxMoreApps.Size = new System.Drawing.Size(318, 130);
|
||||
this.groupBoxMoreApps.TabIndex = 5;
|
||||
this.groupBoxMoreApps.TabStop = false;
|
||||
this.groupBoxMoreApps.Text = "More utilities from RL Vision";
|
||||
//
|
||||
// label33
|
||||
//
|
||||
this.label33.AutoSize = true;
|
||||
this.label33.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label33.Location = new System.Drawing.Point(210, 29);
|
||||
this.label33.Name = "label33";
|
||||
this.label33.Size = new System.Drawing.Size(91, 13);
|
||||
this.label33.TabIndex = 13;
|
||||
this.label33.Text = "Flash Renamer";
|
||||
//
|
||||
// label32
|
||||
//
|
||||
this.label32.AutoSize = true;
|
||||
this.label32.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label32.Location = new System.Drawing.Point(66, 29);
|
||||
this.label32.Name = "label32";
|
||||
this.label32.Size = new System.Drawing.Size(66, 13);
|
||||
this.label32.TabIndex = 10;
|
||||
this.label32.Text = "Snap2IMG";
|
||||
//
|
||||
// linkLabel3
|
||||
//
|
||||
this.linkLabel3.AutoSize = true;
|
||||
this.linkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel3.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel3.Location = new System.Drawing.Point(66, 100);
|
||||
this.linkLabel3.Name = "linkLabel3";
|
||||
this.linkLabel3.Size = new System.Drawing.Size(51, 13);
|
||||
this.linkLabel3.TabIndex = 12;
|
||||
this.linkLabel3.TabStop = true;
|
||||
this.linkLabel3.Tag = "http://www.rlvision.com/snap2html/about.asp";
|
||||
this.linkLabel3.Text = "More info";
|
||||
this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
|
||||
//
|
||||
// label17
|
||||
//
|
||||
this.label17.Location = new System.Drawing.Point(66, 42);
|
||||
this.label17.Name = "label17";
|
||||
this.label17.Size = new System.Drawing.Size(100, 74);
|
||||
this.label17.TabIndex = 11;
|
||||
this.label17.Text = "Generate contact sheets (thumbnail index) for folders on your hard drive.";
|
||||
//
|
||||
// linkLabel2
|
||||
//
|
||||
this.linkLabel2.AutoSize = true;
|
||||
this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel2.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel2.Location = new System.Drawing.Point(210, 100);
|
||||
this.linkLabel2.Name = "linkLabel2";
|
||||
this.linkLabel2.Size = new System.Drawing.Size(51, 13);
|
||||
this.linkLabel2.TabIndex = 10;
|
||||
this.linkLabel2.TabStop = true;
|
||||
this.linkLabel2.Tag = "http://www.rlvision.com/flashren/about.asp";
|
||||
this.linkLabel2.Text = "More info";
|
||||
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.Location = new System.Drawing.Point(210, 42);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(102, 71);
|
||||
this.label11.TabIndex = 9;
|
||||
this.label11.Text = "File renaming utility with lots of time saving automation features.";
|
||||
//
|
||||
// pictureBox3
|
||||
//
|
||||
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
|
||||
this.pictureBox3.Location = new System.Drawing.Point(169, 29);
|
||||
this.pictureBox3.Name = "pictureBox3";
|
||||
this.pictureBox3.Size = new System.Drawing.Size(39, 48);
|
||||
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBox3.TabIndex = 1;
|
||||
this.pictureBox3.TabStop = false;
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
|
||||
this.pictureBox2.Location = new System.Drawing.Point(12, 29);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(48, 48);
|
||||
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBox2.TabIndex = 0;
|
||||
this.pictureBox2.TabStop = false;
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.Location = new System.Drawing.Point(24, 6);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(128, 128);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBox1.TabIndex = 4;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// linkLabel1
|
||||
//
|
||||
this.linkLabel1.AutoSize = true;
|
||||
this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel1.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel1.Location = new System.Drawing.Point(163, 104);
|
||||
this.linkLabel1.Name = "linkLabel1";
|
||||
this.linkLabel1.Size = new System.Drawing.Size(120, 13);
|
||||
this.linkLabel1.TabIndex = 3;
|
||||
this.linkLabel1.TabStop = true;
|
||||
this.linkLabel1.Text = "http://www.rlvision.com";
|
||||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(163, 87);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(113, 13);
|
||||
this.label5.TabIndex = 2;
|
||||
this.label5.Text = "Freeware by RL Vision";
|
||||
//
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.AutoSize = true;
|
||||
this.labelVersion.Location = new System.Drawing.Point(163, 53);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(41, 13);
|
||||
this.labelVersion.TabIndex = 1;
|
||||
this.labelVersion.Text = "version";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label3.Location = new System.Drawing.Point(161, 23);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(148, 29);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "Snap2HTML";
|
||||
//
|
||||
// folderBrowserDialog1
|
||||
//
|
||||
this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer;
|
||||
this.folderBrowserDialog1.ShowNewFolderButton = false;
|
||||
//
|
||||
// backgroundWorker
|
||||
//
|
||||
this.backgroundWorker.WorkerReportsProgress = true;
|
||||
this.backgroundWorker.WorkerSupportsCancellation = true;
|
||||
this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker_DoWork);
|
||||
this.backgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker_ProgressChanged);
|
||||
this.backgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker_RunWorkerCompleted);
|
||||
//
|
||||
// frmMain
|
||||
//
|
||||
this.AcceptButton = this.cmdCreate;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(354, 373);
|
||||
this.Controls.Add(this.tabControl1);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.DoubleBuffered = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.KeyPreview = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmMain";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Snap2HTML (Press F1 for Help)";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);
|
||||
this.Load += new System.EventHandler(this.frmMain_Load);
|
||||
this.Shown += new System.EventHandler(this.frmMain_Shown);
|
||||
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.frmMain_KeyUp);
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage1.PerformLayout();
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
this.tabPage3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage2.PerformLayout();
|
||||
this.groupBoxMoreApps.ResumeLayout(false);
|
||||
this.groupBoxMoreApps.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.TextBox txtRoot;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button cmdBrowse;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
private System.Windows.Forms.Button cmdCreate;
|
||||
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
|
||||
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label labelVersion;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.ComponentModel.BackgroundWorker backgroundWorker;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.CheckBox chkOpenOutput;
|
||||
private System.Windows.Forms.TextBox txtLinkRoot;
|
||||
private System.Windows.Forms.CheckBox chkLinkFiles;
|
||||
private System.Windows.Forms.CheckBox chkHidden;
|
||||
private System.Windows.Forms.CheckBox chkSystem;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox txtTitle;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.GroupBox groupBoxMoreApps;
|
||||
private System.Windows.Forms.Label label33;
|
||||
private System.Windows.Forms.Label label32;
|
||||
private System.Windows.Forms.LinkLabel linkLabel3;
|
||||
private System.Windows.Forms.Label label17;
|
||||
private System.Windows.Forms.LinkLabel linkLabel2;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.PictureBox pictureBox3;
|
||||
private System.Windows.Forms.PictureBox pictureBox2;
|
||||
private System.Windows.Forms.TabPage tabPage3;
|
||||
private System.Windows.Forms.LinkLabel linkLabel4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.PictureBox pictureBox4;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.LinkLabel linkLabel5;
|
||||
private System.Windows.Forms.Label label8;
|
||||
}
|
||||
}
|
||||
|
266
Snap2HTML/frmMain.cs
Normal file
266
Snap2HTML/frmMain.cs
Normal file
@ -0,0 +1,266 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CommandLine.Utility;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
private string outFile = ""; // set when automating via command line
|
||||
private bool initDone = false;
|
||||
|
||||
public frmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmMain_Load( object sender, EventArgs e )
|
||||
{
|
||||
labelVersion.Text = "version " + Application.ProductVersion.Split( '.' )[0] + "." + Application.ProductVersion.Split( '.' )[1];
|
||||
|
||||
// initialize some settings
|
||||
int left = Snap2HTML.Properties.Settings.Default.WindowLeft;
|
||||
int top = Snap2HTML.Properties.Settings.Default.WindowTop;
|
||||
if( left >= 0 ) this.Left = left;
|
||||
if( top >= 0 ) this.Top = top;
|
||||
|
||||
if( System.IO.Directory.Exists( txtRoot.Text ) )
|
||||
{
|
||||
SetRootPath( txtRoot.Text , true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRootPath( "" , false );
|
||||
}
|
||||
|
||||
txtLinkRoot.Enabled = chkLinkFiles.Checked;
|
||||
|
||||
// setup drag & drop handlers
|
||||
tabPage1.DragDrop += DragDropHandler;
|
||||
tabPage1.DragEnter += DragEnterHandler;
|
||||
tabPage1.AllowDrop = true;
|
||||
foreach( Control cnt in tabPage1.Controls )
|
||||
{
|
||||
cnt.DragDrop += DragDropHandler;
|
||||
cnt.DragEnter += DragEnterHandler;
|
||||
cnt.AllowDrop = true;
|
||||
}
|
||||
|
||||
initDone = true;
|
||||
}
|
||||
|
||||
private void frmMain_Shown( object sender, EventArgs e )
|
||||
{
|
||||
// parse command line
|
||||
var commandLine = Environment.CommandLine;
|
||||
var splitCommandLine = Arguments.SplitCommandLine(commandLine);
|
||||
var arguments = new Arguments(splitCommandLine);
|
||||
|
||||
// first test for single argument (ie path only)
|
||||
if (splitCommandLine.Length == 2 && !arguments.Exists("path"))
|
||||
{
|
||||
if (System.IO.Directory.Exists(splitCommandLine[1]))
|
||||
{
|
||||
SetRootPath( splitCommandLine[1] );
|
||||
}
|
||||
}
|
||||
|
||||
if (arguments.IsTrue("hidden")) chkHidden.Checked = true;
|
||||
if (arguments.IsTrue("system")) chkSystem.Checked = true;
|
||||
if( arguments.Exists( "path" ) )
|
||||
{
|
||||
// note: relative paths not handled
|
||||
string path = arguments.Single( "path" );
|
||||
if( !System.IO.Directory.Exists( path ) ) path = Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + path;
|
||||
|
||||
if( System.IO.Directory.Exists( path ) )
|
||||
{
|
||||
SetRootPath( path );
|
||||
|
||||
// if outfile is also given, start generating snapshot
|
||||
if (arguments.Exists("outfile"))
|
||||
{
|
||||
outFile = arguments.Single("outfile");
|
||||
cmdCreate.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// run link/title after path, since path automatically updates title
|
||||
if( arguments.Exists( "link" ) )
|
||||
{
|
||||
chkLinkFiles.Checked = true;
|
||||
txtLinkRoot.Text = arguments.Single( "link" );
|
||||
txtLinkRoot.Enabled = true;
|
||||
}
|
||||
if( arguments.Exists( "title" ) )
|
||||
{
|
||||
txtTitle.Text = arguments.Single( "title" );
|
||||
}
|
||||
}
|
||||
|
||||
private void frmMain_FormClosing( object sender, FormClosingEventArgs e )
|
||||
{
|
||||
if( backgroundWorker.IsBusy ) e.Cancel = true;
|
||||
|
||||
if( outFile == "" ) // don't save settings when automated through command line
|
||||
{
|
||||
Snap2HTML.Properties.Settings.Default.WindowLeft = this.Left;
|
||||
Snap2HTML.Properties.Settings.Default.WindowTop = this.Top;
|
||||
Snap2HTML.Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void cmdBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Desktop; // this makes it possible to select network paths too
|
||||
folderBrowserDialog1.SelectedPath = txtRoot.Text;
|
||||
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
SetRootPath( folderBrowserDialog1.SelectedPath );
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
MessageBox.Show( "Could not select folder: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
SetRootPath( "", false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void cmdCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
// ensure source path format
|
||||
txtRoot.Text = System.IO.Path.GetFullPath( txtRoot.Text );
|
||||
if (txtRoot.Text.EndsWith(@"\")) txtRoot.Text = txtRoot.Text.Substring(0, txtRoot.Text.Length - 1);
|
||||
if ( IsWildcardMatch( "?:" , txtRoot.Text , false ) ) txtRoot.Text += @"\"; // add backslash to path if only letter and colon eg "c:"
|
||||
|
||||
// add slash or backslash to end of link (in cases where it is clearthat we we can)
|
||||
if( !txtLinkRoot.Text.EndsWith( @"/" ) && txtLinkRoot.Text.ToLower().StartsWith( @"http" ) ) // web site
|
||||
{
|
||||
txtLinkRoot.Text += @"/";
|
||||
}
|
||||
if( !txtLinkRoot.Text.EndsWith( @"\" ) && IsWildcardMatch( "?:*" , txtLinkRoot.Text , false )) // local disk
|
||||
{
|
||||
txtLinkRoot.Text += @"\";
|
||||
}
|
||||
|
||||
// get output file
|
||||
if( outFile == "" )
|
||||
{
|
||||
string fileName = new System.IO.DirectoryInfo( txtRoot.Text + @"\" ).Name;
|
||||
char[] invalid = System.IO.Path.GetInvalidFileNameChars();
|
||||
for (int i = 0; i < invalid.Length; i++)
|
||||
{
|
||||
fileName = fileName.Replace(invalid[i].ToString(), "");
|
||||
}
|
||||
|
||||
saveFileDialog1.DefaultExt = "html";
|
||||
if( !fileName.ToLower().EndsWith( ".html" ) ) fileName += ".html";
|
||||
saveFileDialog1.FileName = fileName;
|
||||
saveFileDialog1.InitialDirectory = System.IO.Path.GetDirectoryName(txtRoot.Text);
|
||||
if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
|
||||
}
|
||||
else // command line
|
||||
{
|
||||
saveFileDialog1.FileName = outFile;
|
||||
}
|
||||
|
||||
if( !saveFileDialog1.FileName.ToLower().EndsWith( ".html" ) ) saveFileDialog1.FileName += ".html";
|
||||
|
||||
// make sure output path exists
|
||||
if( !System.IO.Directory.Exists( System.IO.Path.GetDirectoryName( saveFileDialog1.FileName ) ) )
|
||||
{
|
||||
MessageBox.Show( "The output folder does not exists...\n\n" + System.IO.Path.GetDirectoryName( saveFileDialog1.FileName ), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
return;
|
||||
}
|
||||
|
||||
// begin generating html
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
this.Text = "Snap2HTML (Working... Press Escape to Cancel)";
|
||||
tabControl1.Enabled = false;
|
||||
backgroundWorker.RunWorkerAsync();
|
||||
|
||||
}
|
||||
|
||||
private void chkLinkFiles_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (chkLinkFiles.Checked == true)
|
||||
txtLinkRoot.Enabled = true;
|
||||
else
|
||||
txtLinkRoot.Enabled = false;
|
||||
}
|
||||
|
||||
// Link Label handlers
|
||||
private void linkLabel1_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com" );
|
||||
}
|
||||
private void linkLabel3_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com/snap2img/about.asp" );
|
||||
}
|
||||
private void linkLabel2_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com/flashren/about.asp" );
|
||||
}
|
||||
private void linkLabel4_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( "notepad.exe", System.IO.Path.GetDirectoryName( Application.ExecutablePath ) + "\\template.html" );
|
||||
}
|
||||
private void linkLabel5_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com/contact.asp" );
|
||||
}
|
||||
|
||||
// Drag & Drop handlers
|
||||
private void DragEnterHandler( object sender, DragEventArgs e )
|
||||
{
|
||||
if( e.Data.GetDataPresent( DataFormats.FileDrop ) )
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
private void DragDropHandler( object sender, DragEventArgs e )
|
||||
{
|
||||
if( e.Data.GetDataPresent( DataFormats.FileDrop ) )
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData( DataFormats.FileDrop );
|
||||
if( files.Length == 1 && System.IO.Directory.Exists( files[0] ) )
|
||||
{
|
||||
SetRootPath( files[0] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Escape to cancel
|
||||
private void frmMain_KeyUp( object sender, KeyEventArgs e )
|
||||
{
|
||||
if( backgroundWorker.IsBusy )
|
||||
{
|
||||
if( e.KeyCode == Keys.Escape )
|
||||
{
|
||||
backgroundWorker.CancelAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( e.KeyCode == Keys.F1 )
|
||||
{
|
||||
System.Diagnostics.Process.Start( System.IO.Path.GetDirectoryName( Application.ExecutablePath ) + "\\ReadMe.txt" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
1539
Snap2HTML/frmMain.resx
Normal file
1539
Snap2HTML/frmMain.resx
Normal file
File diff suppressed because it is too large
Load Diff
268
Snap2HTML/frmMain_BackgroundWorker.cs
Normal file
268
Snap2HTML/frmMain_BackgroundWorker.cs
Normal file
@ -0,0 +1,268 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CommandLine.Utility;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
private void backgroundWorker_DoWork( object sender, DoWorkEventArgs e )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "Reading folders..." );
|
||||
var sbDirArrays = new StringBuilder();
|
||||
int prevDepth = -100;
|
||||
|
||||
// Get all folders
|
||||
var dirs = new List<string>();
|
||||
dirs.Insert( 0, txtRoot.Text );
|
||||
var skipHidden = ( chkHidden.CheckState == CheckState.Unchecked );
|
||||
var skipSystem = ( chkSystem.CheckState == CheckState.Unchecked );
|
||||
DirSearch( txtRoot.Text, dirs, skipHidden, skipSystem );
|
||||
dirs = SortDirList( dirs );
|
||||
|
||||
if( backgroundWorker.CancellationPending )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "User cancelled" );
|
||||
return;
|
||||
}
|
||||
|
||||
int totDirs = 0;
|
||||
dirs.Add( "*EOF*" );
|
||||
long totSize = 0;
|
||||
int totFiles = 0;
|
||||
var lineBreakSymbol = ""; // could set to \n to make html more readable at the expense of increased size
|
||||
|
||||
// Get files in folders
|
||||
for( int d = 0; d < dirs.Count; d++ )
|
||||
{
|
||||
string currentDir = dirs[d];
|
||||
|
||||
try
|
||||
{
|
||||
int newDepth = currentDir.Split( System.IO.Path.DirectorySeparatorChar ).Length;
|
||||
if( currentDir.Length < 64 && currentDir == System.IO.Path.GetPathRoot( currentDir ) ) newDepth--; // fix reading from rootfolder, <64 to avoid going over MAX_PATH
|
||||
|
||||
prevDepth = newDepth;
|
||||
|
||||
var sbCurrentDirArrays = new StringBuilder();
|
||||
|
||||
if( currentDir != "*EOF*" )
|
||||
{
|
||||
bool no_problem = true;
|
||||
|
||||
try
|
||||
{
|
||||
var files = new List<string>( System.IO.Directory.GetFiles( currentDir, "*.*", System.IO.SearchOption.TopDirectoryOnly ) );
|
||||
files.Sort();
|
||||
int f = 0;
|
||||
|
||||
string last_write_date = "-";
|
||||
last_write_date = System.IO.Directory.GetLastWriteTime( currentDir ).ToLocalTime().ToString();
|
||||
long dir_size = 0;
|
||||
|
||||
sbCurrentDirArrays.Append( "D.p([" + lineBreakSymbol );
|
||||
var sDirWithForwardSlash = currentDir.Replace( @"\", "/" );
|
||||
sbCurrentDirArrays.Append( "\"" ).Append( MakeCleanJsString( sDirWithForwardSlash ) ).Append( "*" ).Append( dir_size ).Append( "*" ).Append( last_write_date ).Append( "\"," + lineBreakSymbol );
|
||||
f++;
|
||||
long dirSize = 0;
|
||||
foreach( string sFile in files )
|
||||
{
|
||||
bool bInclude = true;
|
||||
long fi_length = 0;
|
||||
last_write_date = "-";
|
||||
try
|
||||
{
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo( sFile );
|
||||
if( ( fi.Attributes & System.IO.FileAttributes.Hidden ) == System.IO.FileAttributes.Hidden && chkHidden.CheckState != CheckState.Checked ) bInclude = false;
|
||||
if( ( fi.Attributes & System.IO.FileAttributes.System ) == System.IO.FileAttributes.System && chkSystem.CheckState != CheckState.Checked ) bInclude = false;
|
||||
fi_length = fi.Length;
|
||||
|
||||
try
|
||||
{
|
||||
last_write_date = fi.LastWriteTime.ToLocalTime().ToString();
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
}
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
bInclude = false;
|
||||
}
|
||||
|
||||
if( bInclude )
|
||||
{
|
||||
sbCurrentDirArrays.Append( "\"" ).Append( MakeCleanJsString( System.IO.Path.GetFileName( sFile ) ) ).Append( "*" ).Append( fi_length ).Append( "*" ).Append( last_write_date ).Append( "\"," + lineBreakSymbol );
|
||||
totSize += fi_length;
|
||||
dirSize += fi_length;
|
||||
totFiles++;
|
||||
f++;
|
||||
|
||||
if( totFiles % 9 == 0 )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "Reading files... " + totFiles + " (" + sFile + ")" );
|
||||
}
|
||||
|
||||
}
|
||||
if( backgroundWorker.CancellationPending )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "Operation Cancelled!" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add total dir size
|
||||
sbCurrentDirArrays.Append( "" ).Append( dirSize ).Append( "," + lineBreakSymbol );
|
||||
|
||||
// Add subfolders
|
||||
string subdirs = "";
|
||||
List<string> lstSubDirs = new List<string>( System.IO.Directory.GetDirectories( currentDir ) );
|
||||
lstSubDirs = SortDirList( lstSubDirs );
|
||||
foreach( string sTmp in lstSubDirs )
|
||||
{
|
||||
int i = dirs.IndexOf( sTmp );
|
||||
if( i != -1 ) subdirs += i + "*";
|
||||
}
|
||||
if( subdirs.EndsWith( "*" ) ) subdirs = subdirs.Remove( subdirs.Length - 1 );
|
||||
sbCurrentDirArrays.Append( "\"" ).Append( subdirs ).Append( "\"" + lineBreakSymbol ); // subdirs
|
||||
sbCurrentDirArrays.Append( "])" );
|
||||
sbCurrentDirArrays.Append( "\n" );
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
no_problem = false;
|
||||
}
|
||||
|
||||
if( no_problem == false ) // We need to keep folder even if error occurred for integrity
|
||||
{
|
||||
var sDirWithForwardSlash = currentDir.Replace( @"\", "/" );
|
||||
sbCurrentDirArrays = new StringBuilder();
|
||||
sbCurrentDirArrays.Append( "D.p([\"" ).Append( MakeCleanJsString( sDirWithForwardSlash ) ).Append( "*0*-\"," + lineBreakSymbol );
|
||||
sbCurrentDirArrays.Append( "0," + lineBreakSymbol ); // total dir size
|
||||
sbCurrentDirArrays.Append( "\"\"" + lineBreakSymbol ); // subdirs
|
||||
sbCurrentDirArrays.Append( "])\n" );
|
||||
no_problem = true;
|
||||
}
|
||||
|
||||
if( no_problem )
|
||||
{
|
||||
sbDirArrays.Append( sbCurrentDirArrays.ToString() );
|
||||
totDirs++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} exception caught: {1}", ex, ex.Message );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// -- Generate Output --
|
||||
|
||||
backgroundWorker.ReportProgress( 0, "Generating HTML file..." );
|
||||
|
||||
// Read template
|
||||
var sbContent = new StringBuilder();
|
||||
try
|
||||
{
|
||||
using( System.IO.StreamReader reader = new System.IO.StreamReader( System.IO.Path.GetDirectoryName( Application.ExecutablePath ) + System.IO.Path.DirectorySeparatorChar + "template.html" ) )
|
||||
{
|
||||
sbContent.Append( reader.ReadToEnd() );
|
||||
}
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
MessageBox.Show( "Failed to open 'Template.html' for reading...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
backgroundWorker.ReportProgress( 0, "An error occurred..." );
|
||||
return;
|
||||
}
|
||||
|
||||
// Build HTML
|
||||
sbContent.Replace( "[DIR DATA]", sbDirArrays.ToString() );
|
||||
sbContent.Replace( "[TITLE]", txtTitle.Text );
|
||||
sbContent.Replace( "[APP LINK]", "http://www.rlvision.com" );
|
||||
sbContent.Replace( "[APP NAME]", Application.ProductName );
|
||||
sbContent.Replace( "[APP VER]", Application.ProductVersion.Split( '.' )[0] + "." + Application.ProductVersion.Split( '.' )[1] );
|
||||
sbContent.Replace( "[GEN TIME]", DateTime.Now.ToString( "t" ) );
|
||||
sbContent.Replace( "[GEN DATE]", DateTime.Now.ToString( "d" ) );
|
||||
sbContent.Replace( "[NUM FILES]", totFiles.ToString() );
|
||||
sbContent.Replace( "[NUM DIRS]", totDirs.ToString() );
|
||||
sbContent.Replace( "[TOT SIZE]", totSize.ToString() );
|
||||
if( chkLinkFiles.Checked )
|
||||
{
|
||||
sbContent.Replace( "[LINK FILES]", "true" );
|
||||
sbContent.Replace( "[LINK ROOT]", txtLinkRoot.Text.Replace( @"\", "/" ) );
|
||||
sbContent.Replace( "[SOURCE ROOT]", txtRoot.Text.Replace( @"\", "/" ) );
|
||||
|
||||
string link_root = txtLinkRoot.Text.Replace( @"\", "/" );
|
||||
if( IsWildcardMatch( @"?:/*", link_root, false ) ) // "file://" is needed in the browser if path begins with drive letter, else it should not be used
|
||||
{
|
||||
sbContent.Replace( "[LINK PROTOCOL]", @"file://" );
|
||||
}
|
||||
else
|
||||
{
|
||||
sbContent.Replace( "[LINK PROTOCOL]", "" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sbContent.Replace( "[LINK FILES]", "false" );
|
||||
sbContent.Replace( "[LINK PROTOCOL]", "" );
|
||||
sbContent.Replace( "[LINK ROOT]", "" );
|
||||
sbContent.Replace( "[SOURCE ROOT]", txtRoot.Text.Replace( @"\", "/" ) );
|
||||
}
|
||||
|
||||
// Write output file
|
||||
try
|
||||
{
|
||||
using( System.IO.StreamWriter writer = new System.IO.StreamWriter( saveFileDialog1.FileName ) )
|
||||
{
|
||||
writer.Write( sbContent.ToString() );
|
||||
}
|
||||
|
||||
if( chkOpenOutput.Checked == true )
|
||||
{
|
||||
System.Diagnostics.Process.Start( saveFileDialog1.FileName );
|
||||
}
|
||||
}
|
||||
catch( System.Exception excpt )
|
||||
{
|
||||
MessageBox.Show( "Failed to open file for writing:\n\n" + excpt, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
backgroundWorker.ReportProgress( 0, "An error occurred..." );
|
||||
return;
|
||||
}
|
||||
|
||||
// Ready!
|
||||
Cursor.Current = Cursors.Default;
|
||||
backgroundWorker.ReportProgress( 100, "Ready!" );
|
||||
}
|
||||
|
||||
private void backgroundWorker_ProgressChanged( object sender, ProgressChangedEventArgs e )
|
||||
{
|
||||
toolStripStatusLabel1.Text = e.UserState.ToString();
|
||||
}
|
||||
|
||||
private void backgroundWorker_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e )
|
||||
{
|
||||
Cursor.Current = Cursors.Default;
|
||||
tabControl1.Enabled = true;
|
||||
this.Text = "Snap2HTML";
|
||||
|
||||
// Quit when finished if automated via command line
|
||||
if( outFile != "" )
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
155
Snap2HTML/frmMain_Helpers.cs
Normal file
155
Snap2HTML/frmMain_Helpers.cs
Normal file
@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CommandLine.Utility;
|
||||
using System.IO;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
// Sets the root path input box and makes related gui parts ready to use
|
||||
private void SetRootPath( string path, bool pathIsValid = true )
|
||||
{
|
||||
if( pathIsValid )
|
||||
{
|
||||
txtRoot.Text = path;
|
||||
cmdCreate.Enabled = true;
|
||||
toolStripStatusLabel1.Text = "";
|
||||
if( initDone )
|
||||
{
|
||||
txtLinkRoot.Text = txtRoot.Text;
|
||||
txtTitle.Text = "Snapshot of " + txtRoot.Text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
txtRoot.Text = "";
|
||||
cmdCreate.Enabled = false;
|
||||
toolStripStatusLabel1.Text = "";
|
||||
if( initDone )
|
||||
{
|
||||
txtLinkRoot.Text = txtRoot.Text;
|
||||
txtTitle.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Recursive function to get all folders and subfolders of given path path
|
||||
private void DirSearch( string sDir, List<string> lstDirs, bool skipHidden, bool skipSystem )
|
||||
{
|
||||
if( backgroundWorker.CancellationPending ) return;
|
||||
|
||||
try
|
||||
{
|
||||
foreach( string d in System.IO.Directory.GetDirectories( sDir ) )
|
||||
{
|
||||
bool includeThisFolder = true;
|
||||
|
||||
if( d.ToUpper().EndsWith( "SYSTEM VOLUME INFORMATION" ) ) includeThisFolder = false;
|
||||
|
||||
// exclude folders that have the system or hidden attr set (if required)
|
||||
if( skipHidden || skipSystem )
|
||||
{
|
||||
var attr = new DirectoryInfo( d ).Attributes;
|
||||
|
||||
if( skipHidden )
|
||||
{
|
||||
if( ( attr & FileAttributes.Hidden ) == FileAttributes.Hidden )
|
||||
{
|
||||
includeThisFolder = false;
|
||||
}
|
||||
}
|
||||
|
||||
if( skipSystem )
|
||||
{
|
||||
if( ( attr & FileAttributes.System ) == FileAttributes.System )
|
||||
{
|
||||
includeThisFolder = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( includeThisFolder )
|
||||
{
|
||||
lstDirs.Add( d );
|
||||
|
||||
if( lstDirs.Count % 9 == 0 ) // for performance don't update gui for each file
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "Aquiring folders... " + lstDirs.Count + " (" + d + ")" );
|
||||
}
|
||||
|
||||
DirSearch( d, lstDirs, skipHidden, skipSystem );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
Console.WriteLine( "ERROR in DirSearch():" + ex.Message );
|
||||
}
|
||||
}
|
||||
|
||||
// Hack to sort folders correctly even if they have spaces/periods in them
|
||||
private List<string> SortDirList( List<string> lstDirs )
|
||||
{
|
||||
for( int n = 0; n < lstDirs.Count; n++ )
|
||||
{
|
||||
lstDirs[n] = lstDirs[n].Replace( " ", "1|1" );
|
||||
lstDirs[n] = lstDirs[n].Replace( ".", "2|2" );
|
||||
}
|
||||
lstDirs.Sort();
|
||||
for( int n = 0; n < lstDirs.Count; n++ )
|
||||
{
|
||||
lstDirs[n] = lstDirs[n].Replace( "1|1", " " );
|
||||
lstDirs[n] = lstDirs[n].Replace( "2|2", "." );
|
||||
}
|
||||
return lstDirs;
|
||||
}
|
||||
|
||||
// Replaces characters that may appear in filenames/paths that have special meaning to JavaScript
|
||||
// Info on u2028/u2029: https://en.wikipedia.org/wiki/Newline#Unicode
|
||||
private string MakeCleanJsString( string s )
|
||||
{
|
||||
return s.Replace( "\\", "\\\\" )
|
||||
.Replace( "&", "&" )
|
||||
.Replace( "\u2028", "" )
|
||||
.Replace( "\u2029", "" );
|
||||
}
|
||||
|
||||
// Test string for matches against a wildcard pattern. Use ? and * as wildcards. (Wrapper around RegEx)
|
||||
private bool IsWildcardMatch( String wildcard, String text, bool casesensitive )
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder( wildcard.Length + 10 );
|
||||
sb.Append( "^" );
|
||||
for( int i = 0; i < wildcard.Length; i++ )
|
||||
{
|
||||
char c = wildcard[i];
|
||||
switch( c )
|
||||
{
|
||||
case '*':
|
||||
sb.Append( ".*" );
|
||||
break;
|
||||
case '?':
|
||||
sb.Append( "." );
|
||||
break;
|
||||
default:
|
||||
sb.Append( System.Text.RegularExpressions.Regex.Escape( wildcard[i].ToString() ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
sb.Append( "$" );
|
||||
System.Text.RegularExpressions.Regex regex;
|
||||
if( casesensitive )
|
||||
regex = new System.Text.RegularExpressions.Regex( sb.ToString(), System.Text.RegularExpressions.RegexOptions.None );
|
||||
else
|
||||
regex = new System.Text.RegularExpressions.Regex( sb.ToString(), System.Text.RegularExpressions.RegexOptions.IgnoreCase );
|
||||
|
||||
return regex.IsMatch( text );
|
||||
}
|
||||
}
|
||||
}
|
BIN
Snap2HTML/icon.ico
Normal file
BIN
Snap2HTML/icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
1560
Snap2HTML/template.html
Normal file
1560
Snap2HTML/template.html
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user