- Autocommit - 2021/10/28 09:01:10
This commit is contained in:
1 parent
ef316aace0
commit
ebe1608e98
7 files changed
+59
-609
No files matched your search
+13
-4
@@ -60,16 +60,22 @@
|
||||
<Compile Include="Data\eLinkState.cs" />
|
||||
<Compile Include="General\Cfg.cs" />
|
||||
<Compile Include="General\cTools.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<Compile Include="Test\Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<Compile Include="Test\Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Logger.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Test\frmTestSite.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Test\frmTestSite.Designer.cs">
|
||||
<DependentUpon>frmTestSite.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Test\Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<EmbeddedResource Include="Test\Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Net\frmDownloader.resx">
|
||||
@@ -84,6 +90,9 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Test\frmTestSite.resx">
|
||||
<DependentUpon>frmTestSite.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
+40
-40
@@ -12,56 +12,56 @@ namespace A69WD {
|
||||
public static A69WD.DBTools DB = null;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args) {
|
||||
try {
|
||||
// Common settings:
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
///// <summary>
|
||||
///// The main entry point for the application.
|
||||
///// </summary>
|
||||
//[STAThread]
|
||||
//static void Main(string[] args) {
|
||||
// try {
|
||||
// // Common settings:
|
||||
// Application.EnableVisualStyles();
|
||||
// Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
if ((args != null) && (args.Length > 0)) Retrive = false;
|
||||
else Retrive = true;
|
||||
// if ((args != null) && (args.Length > 0)) Retrive = false;
|
||||
// else Retrive = true;
|
||||
|
||||
// Configura il logger dell'applicazione:
|
||||
Logger.Configure(Cfg.Settings.PathFileLogs, Cfg.Settings.LogsFileSizeLimitKB, Cfg.Settings.LogsWinLoggerRef);
|
||||
// // Configura il logger dell'applicazione:
|
||||
// Logger.Configure(Cfg.Settings.PathFileLogs, Cfg.Settings.LogsFileSizeLimitKB, Cfg.Settings.LogsWinLoggerRef);
|
||||
|
||||
// Configura il DB dell'applicazione
|
||||
DB = new A69WD.DBTools();
|
||||
// // Configura il DB dell'applicazione
|
||||
// DB = new A69WD.DBTools();
|
||||
|
||||
// Start application:
|
||||
Logger.Information(" - - - START Application - - - ");
|
||||
if (DB.DB_ok) {
|
||||
Application.Run(new frmDownloader());
|
||||
// // Start application:
|
||||
// Logger.Information(" - - - START Application - - - ");
|
||||
// if (DB.DB_ok) {
|
||||
// Application.Run(new frmDownloader());
|
||||
|
||||
Logger.Information(" - - - STOP Application - - - ");
|
||||
// Logger.Information(" - - - STOP Application - - - ");
|
||||
|
||||
while (Logger.LogMissing() > 0) {
|
||||
System.Threading.Thread.Sleep(25);
|
||||
}
|
||||
// while (Logger.LogMissing() > 0) {
|
||||
// System.Threading.Thread.Sleep(25);
|
||||
// }
|
||||
|
||||
// MRK: TODO rivedere la chiusura precedente per farla funzionare senza il tempo ma con il controllo totale dei thread.
|
||||
// // MRK: TODO rivedere la chiusura precedente per farla funzionare senza il tempo ma con il controllo totale dei thread.
|
||||
|
||||
} else {
|
||||
Logger.Error("Collegamento al DB non riuscito");
|
||||
MessageBox.Show("Applicazione abortita perchè non riesco ad aprire il DB", "Error");
|
||||
}
|
||||
// } else {
|
||||
// Logger.Error("Collegamento al DB non riuscito");
|
||||
// MessageBox.Show("Applicazione abortita perchè non riesco ad aprire il DB", "Error");
|
||||
// }
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
Logger.Log(new object[] { "Error Code: ER00000", "Errore in Main()", ex });
|
||||
} finally {
|
||||
// Chiudo DB in memoria riportando sul DB di sistema le modifiche occorse:
|
||||
if (DB != null) {
|
||||
DB.Dispose();
|
||||
DB = null;
|
||||
}
|
||||
// Attesa per svuotamento logger:
|
||||
while (Logger.LogMissing() > 0) { System.Threading.Thread.Sleep(100); }
|
||||
}
|
||||
}
|
||||
// } catch (Exception ex) {
|
||||
// Logger.Log(new object[] { "Error Code: ER00000", "Errore in Main()", ex });
|
||||
// } finally {
|
||||
// // Chiudo DB in memoria riportando sul DB di sistema le modifiche occorse:
|
||||
// if (DB != null) {
|
||||
// DB.Dispose();
|
||||
// DB = null;
|
||||
// }
|
||||
// // Attesa per svuotamento logger:
|
||||
// while (Logger.LogMissing() > 0) { System.Threading.Thread.Sleep(100); }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
Generated
-165
@@ -1,165 +0,0 @@
|
||||
namespace A69WD {
|
||||
partial class Form1 {
|
||||
/// <summary>
|
||||
/// Variabile di progettazione necessaria.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Pulire le risorse in uso.
|
||||
/// </summary>
|
||||
/// <param name="disposing">ha valore true se le risorse gestite devono essere eliminate, false in caso contrario.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Codice generato da Progettazione Windows Form
|
||||
|
||||
/// <summary>
|
||||
/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
|
||||
/// il contenuto del metodo con l'editor di codice.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.lblST = new System.Windows.Forms.Label();
|
||||
this.btnDownloadLink = new System.Windows.Forms.Button();
|
||||
this.btnDownloadAll = new System.Windows.Forms.Button();
|
||||
this.wb1 = new System.Windows.Forms.WebBrowser();
|
||||
this.btnHide = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.lblPath = new System.Windows.Forms.Label();
|
||||
this.tbPath = new System.Windows.Forms.TextBox();
|
||||
this.btbPath = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblST
|
||||
//
|
||||
this.lblST.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.lblST.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.lblST.Location = new System.Drawing.Point(0, 84);
|
||||
this.lblST.Name = "lblST";
|
||||
this.lblST.Size = new System.Drawing.Size(504, 22);
|
||||
this.lblST.TabIndex = 0;
|
||||
this.lblST.Text = "Status";
|
||||
this.lblST.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// btnDownloadLink
|
||||
//
|
||||
this.btnDownloadLink.Location = new System.Drawing.Point(12, 12);
|
||||
this.btnDownloadLink.Name = "btnDownloadLink";
|
||||
this.btnDownloadLink.Size = new System.Drawing.Size(117, 33);
|
||||
this.btnDownloadLink.TabIndex = 1;
|
||||
this.btnDownloadLink.Text = "Download only Link";
|
||||
this.btnDownloadLink.UseVisualStyleBackColor = true;
|
||||
this.btnDownloadLink.Click += new System.EventHandler(this.btnDownloadLink_Click);
|
||||
//
|
||||
// btnDownloadAll
|
||||
//
|
||||
this.btnDownloadAll.Location = new System.Drawing.Point(135, 12);
|
||||
this.btnDownloadAll.Name = "btnDownloadAll";
|
||||
this.btnDownloadAll.Size = new System.Drawing.Size(117, 33);
|
||||
this.btnDownloadAll.TabIndex = 2;
|
||||
this.btnDownloadAll.Text = "Download All";
|
||||
this.btnDownloadAll.UseVisualStyleBackColor = true;
|
||||
this.btnDownloadAll.Click += new System.EventHandler(this.btnDownloadAll_Click);
|
||||
//
|
||||
// wb1
|
||||
//
|
||||
this.wb1.Location = new System.Drawing.Point(0, 1);
|
||||
this.wb1.MinimumSize = new System.Drawing.Size(20, 20);
|
||||
this.wb1.Name = "wb1";
|
||||
this.wb1.ScriptErrorsSuppressed = true;
|
||||
this.wb1.ScrollBarsEnabled = false;
|
||||
this.wb1.Size = new System.Drawing.Size(63, 44);
|
||||
this.wb1.TabIndex = 3;
|
||||
this.wb1.TabStop = false;
|
||||
this.wb1.Visible = false;
|
||||
//
|
||||
// btnHide
|
||||
//
|
||||
this.btnHide.Location = new System.Drawing.Point(258, 12);
|
||||
this.btnHide.Name = "btnHide";
|
||||
this.btnHide.Size = new System.Drawing.Size(117, 33);
|
||||
this.btnHide.TabIndex = 4;
|
||||
this.btnHide.Text = "Hide";
|
||||
this.btnHide.UseVisualStyleBackColor = true;
|
||||
this.btnHide.Click += new System.EventHandler(this.btnHide_Click);
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Location = new System.Drawing.Point(381, 12);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(117, 33);
|
||||
this.btnClose.TabIndex = 5;
|
||||
this.btnClose.Text = "Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// lblPath
|
||||
//
|
||||
this.lblPath.Location = new System.Drawing.Point(12, 47);
|
||||
this.lblPath.Name = "lblPath";
|
||||
this.lblPath.Size = new System.Drawing.Size(117, 33);
|
||||
this.lblPath.TabIndex = 6;
|
||||
this.lblPath.Text = "Destination Path:";
|
||||
this.lblPath.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// tbPath
|
||||
//
|
||||
this.tbPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.tbPath.Location = new System.Drawing.Point(132, 54);
|
||||
this.tbPath.Name = "tbPath";
|
||||
this.tbPath.Size = new System.Drawing.Size(344, 20);
|
||||
this.tbPath.TabIndex = 7;
|
||||
this.tbPath.Text = "C:\\Temporary\\A69WD\\Dst\\";
|
||||
this.tbPath.TextChanged += new System.EventHandler(this.tbPath_TextChanged);
|
||||
//
|
||||
// btbPath
|
||||
//
|
||||
this.btbPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btbPath.Location = new System.Drawing.Point(478, 53);
|
||||
this.btbPath.Name = "btbPath";
|
||||
this.btbPath.Size = new System.Drawing.Size(20, 20);
|
||||
this.btbPath.TabIndex = 8;
|
||||
this.btbPath.Text = ".";
|
||||
this.btbPath.UseVisualStyleBackColor = true;
|
||||
this.btbPath.Click += new System.EventHandler(this.btbPath_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(504, 106);
|
||||
this.Controls.Add(this.btbPath);
|
||||
this.Controls.Add(this.tbPath);
|
||||
this.Controls.Add(this.lblPath);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.btnHide);
|
||||
this.Controls.Add(this.btnDownloadAll);
|
||||
this.Controls.Add(this.btnDownloadLink);
|
||||
this.Controls.Add(this.lblST);
|
||||
this.Controls.Add(this.wb1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "A69 Downloader";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblST;
|
||||
private System.Windows.Forms.Button btnDownloadLink;
|
||||
private System.Windows.Forms.Button btnDownloadAll;
|
||||
private System.Windows.Forms.WebBrowser wb1;
|
||||
private System.Windows.Forms.Button btnHide;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.Label lblPath;
|
||||
private System.Windows.Forms.TextBox tbPath;
|
||||
private System.Windows.Forms.Button btbPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
|
||||
|
||||
namespace A69WD {
|
||||
public partial class Form1 : Form {
|
||||
|
||||
|
||||
List<string> AllLinks = null;
|
||||
List<string> toDownload = null;
|
||||
List<string> Downloaded = null;
|
||||
List<string> RacLinks = null;
|
||||
|
||||
DateTime dtStartTime;
|
||||
|
||||
string[] Tipologie = { "altro", "bdsm", "gay", "incesto", "lesbo", "orge", "prime", "scambio", "tradimenti", "trans", "trio" };
|
||||
|
||||
const string BASE_URL = "https://www.annunci69.it/racconti-erotici/{Tip}.html";
|
||||
const string BASE_LINK_IDX = "https://www.annunci69.it/racconti-erotici/racconti_lista.php";
|
||||
const string BASE_LINK_RAC = "https://www.annunci69.it/racconti-erotici/";
|
||||
|
||||
const int MAXLINK = 1000;
|
||||
int cnt = 0;
|
||||
|
||||
bool aborting = false;
|
||||
bool DownRac = false;
|
||||
|
||||
|
||||
public string DstIdx {
|
||||
get {
|
||||
if (string.IsNullOrEmpty(dstIdx)) {
|
||||
// creo path e verifico l'esistenza
|
||||
dstIdx = Path.Combine(System.IO.Path.Combine(tbPath.Text, DateTime.Now.ToString("yyyy-MM-dd")), "Indici");
|
||||
if (!Directory.Exists(dstIdx)) Directory.CreateDirectory(dstIdx);
|
||||
}
|
||||
return dstIdx;
|
||||
}
|
||||
}
|
||||
private string dstIdx = "";
|
||||
|
||||
|
||||
public string DstRac {
|
||||
get {
|
||||
if (string.IsNullOrEmpty(dstRac)) {
|
||||
// creo path e verifico l'esistenza
|
||||
dstRac = Path.Combine(System.IO.Path.Combine(tbPath.Text, DateTime.Now.ToString("yyyy-MM-dd")), "Testi");
|
||||
if (!Directory.Exists(dstRac)) Directory.CreateDirectory(dstRac);
|
||||
}
|
||||
return dstRac;
|
||||
}
|
||||
}
|
||||
private string dstRac = "";
|
||||
|
||||
|
||||
|
||||
|
||||
// Mettere che alla chiusura del form, salvo i valori degli elenchi tramite serializzzazione
|
||||
|
||||
|
||||
|
||||
public Form1() {
|
||||
InitializeComponent();
|
||||
// Inizializzo gli archivi (dai file in memoria)
|
||||
AllLinks = new List<string>();
|
||||
toDownload = new List<string>();
|
||||
Downloaded = new List<string>();
|
||||
RacLinks = new List<string>();
|
||||
|
||||
wb1.DocumentCompleted += Wb_DocumentCompleted;
|
||||
// Per ora non serializzo gli archivi e quindi carico le pagine iniziali delle 11 tipologie:
|
||||
foreach (string tipologia in Tipologie) {
|
||||
toDownload.Add(BASE_URL.Replace("{Tip}", tipologia));
|
||||
AllLinks.Add(BASE_URL.Replace("{Tip}", tipologia));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void btnDownloadLink_Click(object sender, EventArgs e) {
|
||||
dtStartTime = DateTime.Now;
|
||||
|
||||
DownRac = false;
|
||||
|
||||
UpdateST("Inizio lo scrap dei link dei racconti");
|
||||
if ((toDownload.Count > 0) && (cnt < MAXLINK)) {
|
||||
// proseguo con il download:
|
||||
string lk = toDownload.First();
|
||||
toDownload.Remove(lk);
|
||||
wb1.Navigate(lk);
|
||||
}
|
||||
|
||||
btnDownloadLink.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
private void btnDownloadAll_Click(object sender, EventArgs e) {
|
||||
dtStartTime = DateTime.Now;
|
||||
|
||||
DownRac = true;
|
||||
|
||||
UpdateST("Inizio lo scrap dei link dei racconti");
|
||||
if ((toDownload.Count > 0) && (cnt < MAXLINK)) {
|
||||
// proseguo con il download:
|
||||
string lk = toDownload.First();
|
||||
toDownload.Remove(lk);
|
||||
wb1.Navigate(lk);
|
||||
}
|
||||
|
||||
btnDownloadLink.Enabled = false;
|
||||
}
|
||||
|
||||
|
||||
private void btnHide_Click(object sender, EventArgs e) { MessageBox.Show("Metodo ancora da fare"); }
|
||||
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e) { aborting = true; }
|
||||
|
||||
|
||||
private void btbPath_Click(object sender, EventArgs e) { MessageBox.Show("Metodo ancora da fare"); }
|
||||
|
||||
|
||||
private void tbPath_TextChanged(object sender, EventArgs e) {
|
||||
dstIdx = dstRac = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void Wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) {
|
||||
object obj = new Object();
|
||||
lock (obj) {
|
||||
cnt++;
|
||||
StringBuilder sb;
|
||||
|
||||
WebBrowser wb = sender as WebBrowser;
|
||||
string link = wb.Url.ToString();
|
||||
|
||||
// aggiorno UI
|
||||
UpdateST(wb.Name + " - Donwloaded: " + link);
|
||||
|
||||
// Se pagina è un racconto, lo salvo
|
||||
if (IsRacLink(link)) {
|
||||
sb = new StringBuilder();
|
||||
sb.Append(wb.DocumentText);
|
||||
string fn = Path.Combine(DstRac, GetFileName(link));
|
||||
cTools.WriteTextFile(fn, sb);
|
||||
}
|
||||
|
||||
// Registro che ho eseguito il download del link
|
||||
Downloaded.Add(link);
|
||||
|
||||
// Ciclo su tutti i link estratti dalla pagina:
|
||||
foreach (HtmlElement item in wb.Document.Links) {
|
||||
link = item.GetAttribute("href");
|
||||
// Se link nuovo:
|
||||
if (!AllLinks.Contains(link)) {
|
||||
// Link nuovo, mi comporto di conseguenza alla tipologia:
|
||||
if (IsRacLink(link)){
|
||||
// Link ad un racconto
|
||||
AllLinks.Add(link);
|
||||
if (DownRac) { toDownload.Add(link); }
|
||||
RacLinks.Add(link);
|
||||
} else {
|
||||
if (IsIdxLink(link)){
|
||||
// Link ad un indice
|
||||
AllLinks.Add(link);
|
||||
toDownload.Add(link);
|
||||
} else {
|
||||
// Link non riconosciuto, lo scarto
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // fine ciclo sui link estratti
|
||||
|
||||
// Se ho raggiunto il massimo numero di link, o non vi sono link da downloadare, mi fermo:
|
||||
if ((toDownload.Count > 0) && ((cnt < MAXLINK) || (DownRac)) && (!aborting)) {
|
||||
// proseguo con il download:
|
||||
string lk = toDownload.First();
|
||||
toDownload.Remove(lk);
|
||||
wb.Navigate(lk);
|
||||
} else {
|
||||
// Finito download, salvo gli archivi:
|
||||
SaveState();
|
||||
}
|
||||
|
||||
}//lock
|
||||
}
|
||||
|
||||
|
||||
private void SaveState() {
|
||||
StringBuilder sb;
|
||||
|
||||
// Preparo il path di destinazione
|
||||
string dstIdx = Path.Combine(System.IO.Path.Combine(tbPath.Text, DateTime.Now.ToString("yyyy-MM-dd")), "Indici");
|
||||
if (!Directory.Exists(dstIdx)) Directory.CreateDirectory(dstIdx);
|
||||
string dstRac = Path.Combine(System.IO.Path.Combine(tbPath.Text, DateTime.Now.ToString("yyyy-MM-dd")), "Testi");
|
||||
if (!Directory.Exists(dstRac)) Directory.CreateDirectory(dstRac);
|
||||
|
||||
// Finito download, salvo gli archivi:
|
||||
string dt = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
|
||||
|
||||
// Salvo archivio: AllLinks
|
||||
sb = new StringBuilder();
|
||||
AllLinks.Sort();
|
||||
foreach (string lnk in AllLinks) { sb.AppendLine(lnk); }
|
||||
cTools.WriteTextFile(Path.Combine(DstIdx, string.Format("_A69_AllLinks_{0}.tes", dt)), sb);
|
||||
|
||||
// Salvo archivio: toDownload
|
||||
sb = new StringBuilder();
|
||||
toDownload.Sort();
|
||||
foreach (string lnk in toDownload) { sb.AppendLine(lnk); }
|
||||
cTools.WriteTextFile(Path.Combine(DstIdx, string.Format("_A69_toDownload_{0}.tes", dt)), sb);
|
||||
|
||||
// Salvo archivio: Downloaded
|
||||
sb = new StringBuilder();
|
||||
Downloaded.Sort();
|
||||
foreach (string lnk in Downloaded) { sb.AppendLine(lnk); }
|
||||
cTools.WriteTextFile(Path.Combine(DstIdx, string.Format("_A69_Downloaded_{0}.tes", dt)), sb);
|
||||
|
||||
// Salvo archivio: RacLinks
|
||||
sb = new StringBuilder();
|
||||
RacLinks.Sort();
|
||||
foreach (string lnk in RacLinks) { sb.AppendLine(lnk); }
|
||||
cTools.WriteTextFile(Path.Combine(DstIdx, string.Format("_A69_RacLinks_{0}.tes", dt)), sb);
|
||||
|
||||
// avviso utente:
|
||||
UpdateST(string.Format("Finito il download in {0}", DateTime.Now - dtStartTime));
|
||||
|
||||
// Riattivo UI:
|
||||
btnDownloadLink.Enabled = true;
|
||||
btnDownloadAll.Enabled = true;
|
||||
|
||||
// Chiudo applicazione
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void UpdateST(string Msg) { lblST.Text = string.Format("{0} - {1} - {2}", DateTime.Now.ToString("HH:mm:ss"), cnt.ToString("0000"), Msg); }
|
||||
private string GetFileName(string url) { return url.Replace("https://www.annunci69.it/racconti-erotici/", "A69_").Replace("/", "_").Replace(":", "_").Replace(@"\", "_"); }
|
||||
private bool IsIdxLink(string link) { return link.StartsWith(BASE_LINK_IDX); }
|
||||
private bool IsRacLink(string link) { foreach (string tip in Tipologie) { if (link.StartsWith(BASE_LINK_RAC + tip + "/")) return true; } return false; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<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" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace A69WD {
|
||||
static class Program {
|
||||
///// <summary>
|
||||
///// Punto di ingresso principale dell'applicazione.
|
||||
///// </summary>
|
||||
//[STAThread]
|
||||
//static void Main() {
|
||||
// Application.EnableVisualStyles();
|
||||
// Application.SetCompatibleTextRenderingDefault(false);
|
||||
// Application.Run(new Form1());
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user