Selaa lähdekoodia

fix a bug. now it works with new DOM.

Hansi7 10 vuotta sitten
vanhempi
säilyke
475df693ff

+ 40 - 0
.gitignore

@@ -0,0 +1,40 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+
+[Dd]ebug/
+[Rr]elease/
+x64/
+build/
+[Bb]in/
+[Oo]bj/
+Lib/
+
+
+#example
+
+ASYC/
+
+# =========================
+# Windows detritus
+# =========================
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Mac crap
+.DS_Store
+

+ 2 - 2
ASYC/ASYC.csproj

@@ -75,9 +75,9 @@
     </Compile>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\Arzon\Arzon.csproj">
+    <ProjectReference Include="..\Arzon\Gets.csproj">
       <Project>{9262f4c4-2d81-41ab-a444-57d3a21cea9b}</Project>
-      <Name>Arzon</Name>
+      <Name>Gets</Name>
     </ProjectReference>
     <ProjectReference Include="..\Entity\Entity.csproj">
       <Project>{21d25a8a-680f-4c0a-815b-ae394905a64a}</Project>

+ 0 - 14
ASYC/obj/Debug/ASYC.csproj.FileListAbsolute.txt

@@ -11,17 +11,3 @@ C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\ASYC
 C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\ASYC\bin\Debug\HtmlAgilityPack.dll
 C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\ASYC\bin\Debug\Gets.pdb
 C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\ASYC\bin\Debug\Entity.pdb
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\DB\AVDB.accdb
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\ASYC.exe
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\ASYC.pdb
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\Entity.dll
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\Gets.dll
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\HtmlAgilityPack.dll
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\Gets.pdb
-E:\Codes\AVsorter\AVsorter\ASYC\bin\Debug\Entity.pdb
-E:\Codes\AVsorter\AVsorter\ASYC\obj\Debug\ASYC.csprojResolveAssemblyReference.cache
-E:\Codes\AVsorter\AVsorter\ASYC\obj\Debug\ASYC.Form1.resources
-E:\Codes\AVsorter\AVsorter\ASYC\obj\Debug\ASYC.Properties.Resources.resources
-E:\Codes\AVsorter\AVsorter\ASYC\obj\Debug\ASYC.csproj.GenerateResource.Cache
-E:\Codes\AVsorter\AVsorter\ASYC\obj\Debug\ASYC.exe
-E:\Codes\AVsorter\AVsorter\ASYC\obj\Debug\ASYC.pdb

+ 1 - 1
AVsorter.sln

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2012
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PicSo", "PicSo\PicSo.csproj", "{1A9F40ED-0402-4145-9140-0C153B989983}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arzon", "Arzon\Arzon.csproj", "{9262F4C4-2D81-41AB-A444-57D3A21CEA9B}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gets", "Arzon\Gets.csproj", "{9262F4C4-2D81-41AB-A444-57D3A21CEA9B}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Entity", "Entity\Entity.csproj", "{21D25A8A-680F-4C0A-815B-AE394905A64A}"
 EndProject

BIN
AVsorter.v11.suo


+ 11 - 1
Arzon/Arzon.cs

@@ -284,7 +284,17 @@ namespace Gets
                 //タグ:       标签
                 var item9 = docc.DocumentNode.SelectSingleNode("//table[@class='item']/tr[9]/td[2]").InnerText.Trim();
                 //作品紹介
-                var descrition = docc.DocumentNode.SelectSingleNode("//div[@class='item_text']").InnerText.Trim();
+                string descrition;
+                try
+                {
+                    descrition = docc.DocumentNode.SelectSingleNode("//div[@class='item_text']").InnerText.Trim();
+                }
+                catch (Exception)
+                {
+
+                    descrition = "";
+                }
+                
 
 
 

+ 69 - 0
Arzon/Gets.csproj

@@ -0,0 +1,69 @@
+<?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>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{9262F4C4-2D81-41AB-A444-57D3A21CEA9B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Gets</RootNamespace>
+    <AssemblyName>Gets</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </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>
+  </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>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HtmlAgilityPack">
+      <HintPath>.\HtmlAgilityPack.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Arzon.cs" />
+    <Compile Include="AVEntertainments.cs" />
+    <Compile Include="MywebClient.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Entity\Entity.csproj">
+      <Project>{21D25A8A-680F-4C0A-815B-AE394905A64A}</Project>
+      <Name>Entity</Name>
+    </ProjectReference>
+  </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>

+ 0 - 7
Entity/obj/Debug/Entity.csproj.FileListAbsolute.txt

@@ -25,10 +25,3 @@ C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\Enti
 C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\Entity\obj\Debug\Entity.pdb
 C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\Entity\obj\Debug\Entity.csprojResolveAssemblyReference.cache
 C:\Users\su\Desktop\PICSOUL2014年8月20日\PICSOUL2014年8月20日\PICSOUL\Entity\obj\Debug\AVSORTER.Properties.Resources.resources
-E:\Codes\AVsorter\AVsorter\Entity\bin\Debug\DB\AVDB.accdb
-E:\Codes\AVsorter\AVsorter\Entity\bin\Debug\Entity.dll
-E:\Codes\AVsorter\AVsorter\Entity\bin\Debug\Entity.pdb
-E:\Codes\AVsorter\AVsorter\Entity\obj\Debug\AVSORTER.Properties.Resources.resources
-E:\Codes\AVsorter\AVsorter\Entity\obj\Debug\Entity.csproj.GenerateResource.Cache
-E:\Codes\AVsorter\AVsorter\Entity\obj\Debug\Entity.dll
-E:\Codes\AVsorter\AVsorter\Entity\obj\Debug\Entity.pdb

+ 26 - 26
PicSo/Form1.Designer.cs

@@ -59,14 +59,14 @@
             this.label2 = new System.Windows.Forms.Label();
             this.txt_sub = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
+            this.bc = new AVSORTER.BasicContainer();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.listBox1 = new System.Windows.Forms.ListBox();
             this.cb_AutoCorrect = new System.Windows.Forms.CheckBox();
+            this.movieContainer1 = new PicSo.MovieContainer();
             this.btn_LocalSearch = new System.Windows.Forms.Button();
             this.txt_LocalSearchKeyWord = new System.Windows.Forms.TextBox();
-            this.bc = new AVSORTER.BasicContainer();
-            this.movieContainer1 = new PicSo.MovieContainer();
             this.contextMenuStrip1.SuspendLayout();
             this.tabPage1.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -141,7 +141,7 @@
             // 
             // btn_rebuild
             // 
-            this.btn_rebuild.Location = new System.Drawing.Point(681, 460);
+            this.btn_rebuild.Location = new System.Drawing.Point(681, 461);
             this.btn_rebuild.Name = "btn_rebuild";
             this.btn_rebuild.Size = new System.Drawing.Size(119, 60);
             this.btn_rebuild.TabIndex = 20;
@@ -173,7 +173,7 @@
             this.btn_AddNewEmptyItem.Name = "btn_AddNewEmptyItem";
             this.btn_AddNewEmptyItem.Size = new System.Drawing.Size(127, 23);
             this.btn_AddNewEmptyItem.TabIndex = 19;
-            this.btn_AddNewEmptyItem.Text = "Add New Item";
+            this.btn_AddNewEmptyItem.Text = "新建查询条目";
             this.btn_AddNewEmptyItem.UseVisualStyleBackColor = true;
             this.btn_AddNewEmptyItem.Click += new System.EventHandler(this.btn_AddNewEmptyItem_Click);
             // 
@@ -369,6 +369,18 @@
             this.label1.TabIndex = 12;
             this.label1.Text = "目标路径";
             // 
+            // bc
+            // 
+            this.bc.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.bc.IsShowPic = false;
+            this.bc.ListMovieBasic = null;
+            this.bc.Location = new System.Drawing.Point(6, 341);
+            this.bc.MovieB = null;
+            this.bc.Name = "bc";
+            this.bc.Size = new System.Drawing.Size(411, 180);
+            this.bc.TabIndex = 7;
+            this.bc.Load += new System.EventHandler(this.bc_Load);
+            // 
             // tabControl1
             // 
             this.tabControl1.Controls.Add(this.tabPage1);
@@ -416,6 +428,16 @@
             this.cb_AutoCorrect.Text = "自动改正";
             this.cb_AutoCorrect.UseVisualStyleBackColor = true;
             // 
+            // movieContainer1
+            // 
+            this.movieContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.movieContainer1.Location = new System.Drawing.Point(6, 176);
+            this.movieContainer1.Movie = null;
+            this.movieContainer1.MovieList = null;
+            this.movieContainer1.Name = "movieContainer1";
+            this.movieContainer1.Size = new System.Drawing.Size(913, 375);
+            this.movieContainer1.TabIndex = 2;
+            // 
             // btn_LocalSearch
             // 
             this.btn_LocalSearch.Location = new System.Drawing.Point(309, 4);
@@ -434,28 +456,6 @@
             this.txt_LocalSearchKeyWord.TabIndex = 0;
             this.txt_LocalSearchKeyWord.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txt_LocalSearchKeyWord_KeyPress);
             // 
-            // bc
-            // 
-            this.bc.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.bc.IsShowPic = false;
-            this.bc.ListMovieBasic = null;
-            this.bc.Location = new System.Drawing.Point(6, 341);
-            this.bc.MovieB = null;
-            this.bc.Name = "bc";
-            this.bc.Size = new System.Drawing.Size(411, 180);
-            this.bc.TabIndex = 7;
-            this.bc.Load += new System.EventHandler(this.bc_Load);
-            // 
-            // movieContainer1
-            // 
-            this.movieContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.movieContainer1.Location = new System.Drawing.Point(6, 176);
-            this.movieContainer1.Movie = null;
-            this.movieContainer1.MovieList = null;
-            this.movieContainer1.Name = "movieContainer1";
-            this.movieContainer1.Size = new System.Drawing.Size(913, 375);
-            this.movieContainer1.TabIndex = 2;
-            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 31 - 16
PicSo/Form1.cs

@@ -209,32 +209,42 @@ namespace PicSo
         private void btn_MoveFile_Click(object sender, EventArgs e)
         {
             this.btn_MoveFile.Enabled = false;
-            initFileProcessor();
-            foreach (ListViewItem item in listView1.Items)
+            try
             {
-                if ((item.Tag as AVSORTER.SearchItem).IsSelected == true)
+                initFileProcessor();
+                foreach (ListViewItem item in listView1.Items)
                 {
-                    if (item.Text!="No File")
+                    if ((item.Tag as AVSORTER.SearchItem).IsSelected == true)
                     {
-                        AVSORTER.FileProcessor.GetInstance().MakeMove((item.Tag as AVSORTER.SearchItem).MovieDetail, item.Text);
-                        item.SubItems[2].Text = "移动成功!";
+                        if (item.Text != "No File")
+                        {
+                            AVSORTER.FileProcessor.GetInstance().MakeMove((item.Tag as AVSORTER.SearchItem).MovieDetail, item.Text);
+                            item.SubItems[2].Text = "移动成功!";
+                        }
+                        else
+                        {
+                            item.SubItems[2].Text = "未移动";
+                        }
+
+
+
                     }
                     else
                     {
-                        item.SubItems[2].Text = "未移动";
+                        item.SubItems[2].Text = "未指定对应影片信息";
                     }
-                    
 
-                    
-                }
-                else
-                {
-                    item.SubItems[2].Text = "未指定对应影片信息";
                 }
-
+                AVSORTER.FileProcessor.GetInstance().WriteLog();
+            }
+            catch(Exception err )
+            {
+                MessageBox.Show(err.Message);
+            }
+            finally
+            {
+                this.btn_MoveFile.Enabled = true;
             }
-            AVSORTER.FileProcessor.GetInstance().WriteLog();
-            this.btn_MoveFile.Enabled = true;
         }
 
         private void menu_BrowerFile_Click(object sender, EventArgs e)
@@ -248,6 +258,11 @@ namespace PicSo
         private void menu_ChangeFcode_Click(object sender, EventArgs e)
         {
             var inp = new InputBox();
+            if (listView1.SelectedItems.Count>0)
+            {
+                inp.InputText = listView1.SelectedItems[0].SubItems[1].Text;
+            }
+
             if (inp.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 listView1.SelectedItems[0].SubItems[1].Text = inp.InputText;

+ 1 - 0
PicSo/InputBox.Designer.cs

@@ -61,6 +61,7 @@
             this.Name = "InputBox";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "输入";
+            this.Load += new System.EventHandler(this.InputBox_Load);
             this.ResumeLayout(false);
             this.PerformLayout();
 

+ 6 - 0
PicSo/InputBox.cs

@@ -31,5 +31,11 @@ namespace PicSo
                 this.DialogResult = System.Windows.Forms.DialogResult.OK;
             }
         }
+
+        private void InputBox_Load(object sender, EventArgs e)
+        {
+
+            this.textBox1.Text = this.InputText;
+        }
     }
 }

+ 2 - 2
PicSo/PicSo.csproj

@@ -124,9 +124,9 @@
     </Compile>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\Arzon\Arzon.csproj">
+    <ProjectReference Include="..\Arzon\Gets.csproj">
       <Project>{9262F4C4-2D81-41AB-A444-57D3A21CEA9B}</Project>
-      <Name>Arzon</Name>
+      <Name>Gets</Name>
     </ProjectReference>
     <ProjectReference Include="..\Entity\Entity.csproj">
       <Project>{21D25A8A-680F-4C0A-815B-AE394905A64A}</Project>

+ 1 - 1
PicSo/Program.cs

@@ -15,7 +15,7 @@ namespace PicSo
         {
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new PicSo.Form1());
+            Application.Run(new PicSo.Tester());
         }
     }
 }

+ 76 - 0
PicSo/Tester.Designer.cs

@@ -0,0 +1,76 @@
+namespace PicSo
+{
+    partial class Tester
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Tester));
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // textBox1
+            // 
+            this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.textBox1.Location = new System.Drawing.Point(0, 0);
+            this.textBox1.Multiline = true;
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(729, 453);
+            this.textBox1.TabIndex = 0;
+            this.textBox1.Text = resources.GetString("textBox1.Text");
+            // 
+            // button1
+            // 
+            this.button1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.button1.Location = new System.Drawing.Point(0, 421);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(729, 32);
+            this.button1.TabIndex = 1;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // Tester
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(729, 453);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.textBox1);
+            this.Name = "Tester";
+            this.Text = "Tester";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Button button1;
+    }
+}

+ 41 - 0
PicSo/Tester.cs

@@ -0,0 +1,41 @@
+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;
+
+namespace PicSo
+{
+    public partial class Tester : Form
+    {
+        public Tester()
+        {
+            InitializeComponent();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            var doc = new HtmlAgilityPack.HtmlDocument();
+            doc.LoadHtml(textBox1.Text);
+
+            var nodes = doc.DocumentNode.SelectNodes("//span[@class='subbox']/span[1]");
+            textBox1.Text = "";
+            foreach (var item in nodes)
+            {
+                textBox1.AppendText("\"" + item.InnerText.ToLower() + "\",\r\n");
+            }
+
+
+
+
+
+            Console.WriteLine();
+
+
+            
+        }
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 123 - 0
PicSo/Tester.resx


BIN
PicSo/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä