Browse Source

增加批量获取文件大小,批量获取md5码

yuzhengyang 8 years ago
parent
commit
6a8bfaa8aa

+ 0 - 9
Fork.Net/Fork.Net.sln

@@ -29,8 +29,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Waka.Lego", "Waka.Lego", "{
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{A89FC45A-A907-4487-8719-114530A62684}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpSniffer", "SharpSniffer\SharpSniffer.csproj", "{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oreo.Plugins", "Oreo.Plugins", "{E53B3662-A5FD-4D4C-AFF6-1DC9FF24EA16}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PacketMonitor", "PacketMonitor\PacketMonitor.csproj", "{82B0FE94-1339-42C8-953F-E400CF9F1FF2}"
@@ -127,12 +125,6 @@ Global
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|Any CPU.Build.0 = Release|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|x86.ActiveCfg = Release|Any CPU
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C}.Release|x86.Build.0 = Release|Any CPU
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Debug|Any CPU.ActiveCfg = Debug|x86
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Debug|x86.ActiveCfg = Debug|x86
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Debug|x86.Build.0 = Debug|x86
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Release|Any CPU.ActiveCfg = Release|x86
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Release|x86.ActiveCfg = Release|x86
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}.Release|x86.Build.0 = Release|x86
 		{82B0FE94-1339-42C8-953F-E400CF9F1FF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{82B0FE94-1339-42C8-953F-E400CF9F1FF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{82B0FE94-1339-42C8-953F-E400CF9F1FF2}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -233,7 +225,6 @@ Global
 		{10F1E19E-AEBA-4835-9A58-F02BEC46FF4B} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{0DFAC9FC-9D48-4DCF-AE72-8FB1CA70A06E} = {F32378B4-3DDB-491A-8485-20634188C0FD}
 		{3ECA2CC6-55C2-433F-A617-A7376E455F7C} = {F222E566-DA0C-443C-BB9F-80536F02DB36}
-		{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3} = {A89FC45A-A907-4487-8719-114530A62684}
 		{82B0FE94-1339-42C8-953F-E400CF9F1FF2} = {A89FC45A-A907-4487-8719-114530A62684}
 		{9B9BF25E-0ECD-4923-9546-4FDAEF685092} = {A89FC45A-A907-4487-8719-114530A62684}
 		{A7365B83-32FF-4B92-8C80-A450AC92007F} = {E53B3662-A5FD-4D4C-AFF6-1DC9FF24EA16}

+ 0 - 235
Fork.Net/SharpSniffer/Program.cs

@@ -1,235 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Net;
-using System.Net.Sockets;
-
-namespace SharpSniffer
-{
-
-    class Program
-    {
-        static long AllCount = 0;
-
-        static void Main(string[] args)
-        {
-            Console.WriteLine("Begin this Work");
-            DoWork();
-            Console.Read();
-        }
-        private static void DoWork()
-        {
-            try
-            {
-                //创建socket
-                Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
-
-                using (socket)
-                {
-                    PrintLine("socket created!");
-
-                    //绑定到本机,端口可以任意
-                    var localHostIpAddress = GetHostAdress();
-                    Console.WriteLine("trying to bind to local IP: {0}", localHostIpAddress);
-                    socket.Blocking = false;
-                    socket.Bind(new IPEndPoint(localHostIpAddress, 0));
-                    PrintLine("binded to [" + socket.LocalEndPoint + "]");
-
-                    byte[] outValue = BitConverter.GetBytes(0);
-                    byte[] inValue = BitConverter.GetBytes(1);
-                    socket.IOControl(IOControlCode.ReceiveAll, inValue, outValue);   //对IO设置为可以接受所有包
-                    PrintLine("IOControl seted!");
-
-                    byte[] buf = new byte[65535];   //缓存大一点没关系,小了可能一次放不下
-                    PrintLine("Sniffer begined.");
-
-                    IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 0); //从任何地方接收数据
-
-                    int index = 0;  //表示当前是第几个包(1based)
-
-                    while (true)
-                    {
-                        index++;
-                        try
-                        {
-                            ipep.Address = IPAddress.Any;   //从任何地方接收数据
-                            ipep.Port = 0;
-
-                            EndPoint ep = ipep;
-
-                            int recvedSize = socket.ReceiveFrom(buf, ref ep);   //用ReceiveFrom接受数据
-                                                                                //        socket.Receive(buf);             //用Receive也能接受到数据,不过使用ReceiveFrom可以直接获取发送方IP地址
-                            AllCount += recvedSize;
-
-                            //接收到包了,打印出来
-                            //Print('[');
-                            //Print(GetCurrentTimeString());
-                            //PrintLine("] Received [" + recvedSize + "] bytes from [" + ep.ToString() + "]");
-                            ////string s = Encoding.ASCII.GetString(buf, 0, recvedSize);
-                            ////Print("ASCII: \n");
-                            ////PrintLine(s);
-                            //string s = GetByteArrayHexString(buf, 0, recvedSize);
-                            //Print("Hex: \n");
-                            //PrintLine(s);
-
-                            Print(index);
-                            PrintLine(string.Format(" This: {1:f2} KB  /  AllCount: {1:f2} MB",
-                                (double)recvedSize / 1024, (double)AllCount / 1024 / 1024));
-
-                            if (recvedSize > 1000)
-                            {
-                                PrintLine("////////////////////");
-                            }
-                        }
-                        catch (Exception ex)
-                        {
-                            if (ex is SocketException)
-                            {
-                                var sex = (SocketException)ex;
-                                Console.Error.WriteLine("SocketErrorCode=" + sex.ErrorCode);
-                            }
-                            Console.Error.WriteLine(ex);
-                        }
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                if (ex is SocketException)
-                {
-                    var sex = (SocketException)ex;
-                    Console.Error.WriteLine("SocketErrorCode=" + sex.ErrorCode);
-                }
-                Console.Error.WriteLine(ex);
-            }
-        }
-        //获取本机IP地址
-        private static IPAddress GetHostAdress()
-        {
-            string hostName = Dns.GetHostName();
-            var hostAddreses = Dns.GetHostAddresses(hostName);
-            List<IPAddress> addressList = new List<IPAddress>(hostAddreses.Length);
-            foreach (var item in hostAddreses)
-            {
-                if (item.AddressFamily == AddressFamily.InterNetwork)
-                {
-                    addressList.Add(item);
-                }
-            }
-            if (addressList.Count != 0)
-            {
-                if (addressList.Count == 1)
-                {
-                    return addressList[0];
-                }
-                else
-                {
-                    Console.WriteLine("请选择要绑定到的本机IP地址(IPv4):");
-                    for (int i = 0; i < addressList.Count; i++)
-                    {
-                        var addr = addressList[i];
-                        Console.WriteLine("\t{0}: {1}", i, addr);
-                    }
-                    int sel = int.Parse(Console.ReadLine());
-                    return addressList[sel];
-                }
-            }
-            else
-            {
-                Console.Write("请输入本机IP地址:");
-                string s = Console.ReadLine();
-                return IPAddress.Parse(s);
-            }
-        }
-        //获取表示当前时间的字符串
-        private static string GetCurrentTimeString()
-        {
-            DateTime now = DateTime.Now;
-            return now.Hour + ":" + now.Minute + ":" + now.Second + "." + now.Millisecond;
-        }
-        const string HexValues = "0123456789ABCDEF";
-        //把字节数组转换为十六进制表示的字符串
-        private static string GetByteArrayHexString(byte[] buf, int startIndex, int size)
-        {
-            StringBuilder sb = new StringBuilder(size * 5);
-            sb.AppendFormat("{0,3:X}: ", 0);
-            int j = 1;
-            for (int i = startIndex, n = startIndex + size; i < n; i++, j++)
-            {
-                byte b = buf[i];
-                char c = HexValues[(b & 0x0f0) >> 4];
-                sb.Append(c);
-                c = HexValues[(b & 0x0f)];
-                sb.Append(c);
-                sb.Append(' ');
-                if ((j & 0x0f) == 0)
-                {
-                    sb.Append(' ');
-                    //sb.Append(Encoding.ASCII.GetString(buf,i-15,8));
-                    AppendPrintableBytes(sb, buf, i - 15, 8);
-                    sb.Append(' ');
-                    //sb.Append(Encoding.ASCII.GetString(buf, i - 7, 8));
-                    AppendPrintableBytes(sb, buf, i - 7, 8);
-                    if (i + 1 != n)
-                    {
-                        sb.Append('\n');
-                        sb.AppendFormat("{0,3:X}: ", i - 1);    //偏移
-                    }
-                }
-                else if ((j & 0x07) == 0)
-                {
-                    sb.Append(' ');
-                }
-            }
-            int t;
-            if ((t = ((j - 1) & 0x0f)) != 0)
-            {
-                for (int k = 0, kn = 16 - t; k < kn; k++)
-                {
-                    sb.Append("   ");
-                }
-                if (t <= 8)
-                {
-                    sb.Append(' ');
-                }
-
-                sb.Append(' ');
-                //   sb.Append(Encoding.ASCII.GetString(buf, startIndex + size - t, t>8?8:t));
-                AppendPrintableBytes(sb, buf, startIndex + size - t, t > 8 ? 8 : t);
-                if (t > 8)
-                {
-                    sb.Append(' ');
-                    //   sb.Append(Encoding.ASCII.GetString(buf, startIndex + size - t + 8, t - 8));
-                    AppendPrintableBytes(sb, buf, startIndex + size - t + 8, t - 8);
-                }
-            }
-            return sb.ToString();
-        }
-        //向sb中添加buf中可打印字符,不可打印字符用'.'代替
-        private static void AppendPrintableBytes(StringBuilder sb, byte[] buf, int startIndex, int len)
-        {
-            for (int i = startIndex, n = startIndex + len; i < n; i++)
-            {
-                char c = (char)buf[i];
-                if (!char.IsControl(c))
-                {
-                    sb.Append(c);
-                }
-                else
-                {
-                    sb.Append('.');
-                }
-            }
-        }
-        //打印t+'\n'
-        static void PrintLine<T>(T t)
-        {
-            Console.WriteLine(t);
-        }
-        //打印t
-        static void Print<T>(T t)
-        {
-            Console.Write(t);
-        }
-    }
-}

+ 0 - 36
Fork.Net/SharpSniffer/Properties/AssemblyInfo.cs

@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SharpSniffer")]
-[assembly: AssemblyDescription("C#版Sniffer")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("NUAA")]
-[assembly: AssemblyProduct("SharpSniffer")]
-[assembly: AssemblyCopyright("Copyright © NUAA 2010")]
-[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("fc833fe1-0fc9-42c1-9331-528e4fcabc50")]
-
-// 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("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]

+ 0 - 57
Fork.Net/SharpSniffer/SharpSniffer.csproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{548C259E-A5E8-42CC-BCFF-DAC47CC36AF3}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>SharpSniffer</RootNamespace>
-    <AssemblyName>SharpSniffer</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
-    <TargetFrameworkProfile>
-    </TargetFrameworkProfile>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <Prefer32Bit>false</Prefer32Bit>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <Prefer32Bit>false</Prefer32Bit>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="app.config" />
-  </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 - 3
Fork.Net/SharpSniffer/app.config

@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>

+ 9 - 3
Fork.Net/Y.Utils/AppUtils/StartupTool.cs

@@ -1,12 +1,18 @@
-//############################################################
+//************************************************************************
 //      https://github.com/yuzhengyang
-//      author:yuzhengyang
-//############################################################
+//      author:     yuzhengyang
+//      date:       2017.3.29 - 2017.6.13
+//      desc:       设为开机启动
+//      Copyright (c) yuzhengyang. All rights reserved.
+//************************************************************************
 using System;
 using Y.Utils.WindowsUtils.InfoUtils;
 
 namespace Y.Utils.AppUtils
 {
+    /// <summary>
+    /// 设为开机启动
+    /// </summary>
     public class StartupTool
     {
         [Obsolete]

+ 15 - 0
Fork.Net/Y.Utils/DataUtils/StringUtils/StringTool.cs

@@ -5,6 +5,7 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
+using Y.Utils.DataUtils.Collections;
 
 namespace Y.Utils.DataUtils.StringUtils
 {
@@ -19,5 +20,19 @@ namespace Y.Utils.DataUtils.StringUtils
 
             return false;
         }
+        public static int Split(string str, char separator, out string[] result)
+        {
+            if (!string.IsNullOrWhiteSpace(str))
+            {
+                string[] list = str.Split(separator);
+                if (ListTool.HasElements(list))
+                {
+                    result = list;
+                    return result.Length;
+                }
+            }
+            result = null;
+            return 0;
+        }
     }
 }

+ 13 - 2
Fork.Net/Y.Utils/IOUtils/FileUtils/FilePackageTool.cs

@@ -138,16 +138,27 @@ namespace Y.Utils.IOUtils.FileUtils
         /// <summary>
         /// 打包
         /// </summary>
-        /// <returns></returns>
+        /// <returns>
+        /// -11;//要打包的路径不存在
+        /// -12;//打包后的目标文件已存在
+        /// -13;//要打包的路径中没有文件
+        /// -21;//读取文件大小异常
+        /// </returns>
         public static int Pack(string srcPath, string dstFile, bool overwrite = true)
         {
             DateTime beginTime = DateTime.Now;
-            if (!Directory.Exists(srcPath)) return -11; //要打包的路径不存在
+            if (!Directory.Exists(srcPath)) return -11;//要打包的路径不存在
             if (File.Exists(dstFile) && !overwrite) return -12;//打包后的目标文件已存在
 
             List<string> allfile = FileTool.GetAllFile(srcPath);
             if (ListTool.HasElements(allfile))
             {
+                //读取所有文件的文件大小并检查
+                long[] filesize = FileTool.Size(allfile);
+                foreach (var fs in filesize) { if (fs < 0) return -21; }//读取文件大小异常
+                //读取所有文件的MD5码
+                string[] filemd5 = FileTool.GetMD5(allfile);
+
                 using (FileStream fsWrite = new FileStream(dstFile, FileMode.Create))
                 {
                     allfile.ForEach(x =>

+ 39 - 2
Fork.Net/Y.Utils/IOUtils/FileUtils/FileTool.cs

@@ -168,8 +168,31 @@ namespace Y.Utils.IOUtils.FileUtils
         /// <returns></returns>
         public static long Size(string fileName)
         {
-            FileInfo fi = new FileInfo(fileName);
-            return fi.Length;
+            long result = -1;
+            if (File.Exists(fileName))
+            {
+                try
+                {
+                    FileInfo fi = new FileInfo(fileName);
+                    result = fi.Length;
+                }
+                catch (Exception e) { }
+            }
+            return result;
+        }
+        /// <summary>
+        /// 获取多个文件的大小(字节数)
+        /// </summary>
+        /// <param name="files"></param>
+        /// <returns></returns>
+        public static long[] Size(List<string> files)
+        {
+            long[] result = new long[files.Count];
+            for (int i = 0; i < result.Length; i++)
+            {
+                result[i] = Size(files[i]);
+            }
+            return result;
         }
         /// <summary>
         /// 获取文件大小(根据单位换算)
@@ -208,5 +231,19 @@ namespace Y.Utils.IOUtils.FileUtils
             }
             return result;
         }
+        /// <summary>
+        /// 获取多个文件的MD5特征码
+        /// </summary>
+        /// <param name="file"></param>
+        /// <returns></returns>
+        public static string[] GetMD5(List<string> files)
+        {
+            string[] result = new string[files.Length];
+            for (int i = 0; i < files.Length; i++)
+            {
+                result[i] = GetMD5(files[i]);
+            }
+            return result;
+        }
     }
 }

+ 241 - 241
Fork.Net/Y.Utils/IOUtils/OfficeUtils/WordTool.cs

@@ -1,260 +1,260 @@
-//############################################################
-//      https://github.com/yuzhengyang
-//      author:yuzhengyang
-//############################################################
-using Microsoft.Office.Interop.Word;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+////############################################################
+////      https://github.com/yuzhengyang
+////      author:yuzhengyang
+////############################################################
+//using Microsoft.Office.Interop.Word;
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using System.Text;
+//using System.Threading.Tasks;
 
-namespace Y.Utils.IOUtils.OfficeUtils
-{
-    public class WordTool
-    {
-        private _Application wordApp = null;
-        private _Document wordDoc = null;
-        public _Application Application
-        {
-            get
-            {
-                return wordApp;
-            }
-            set
-            {
-                wordApp = value;
-            }
-        }
-        public _Document Document
-        {
-            get
-            {
-                return wordDoc;
-            }
-            set
-            {
-                wordDoc = value;
-            }
-        }
+//namespace Y.Utils.IOUtils.OfficeUtils
+//{
+//    public class WordTool
+//    {
+//        private _Application wordApp = null;
+//        private _Document wordDoc = null;
+//        public _Application Application
+//        {
+//            get
+//            {
+//                return wordApp;
+//            }
+//            set
+//            {
+//                wordApp = value;
+//            }
+//        }
+//        public _Document Document
+//        {
+//            get
+//            {
+//                return wordDoc;
+//            }
+//            set
+//            {
+//                wordDoc = value;
+//            }
+//        }
 
-        //通过模板创建新文档
-        public void CreateNewDocument(string filePath)
-        {
-            killWinWordProcess();
-            wordApp = new Application();
-            wordApp.DisplayAlerts = WdAlertLevel.wdAlertsNone;
-            wordApp.Visible = false;
-            object missing = System.Reflection.Missing.Value;
-            object templateName = filePath;
-            wordDoc = wordApp.Documents.Open(ref templateName, ref missing,
-            ref missing, ref missing, ref missing, ref missing, ref missing,
-            ref missing, ref missing, ref missing, ref missing, ref missing,
-            ref missing, ref missing, ref missing, ref missing);
-        }
+//        //通过模板创建新文档
+//        public void CreateNewDocument(string filePath)
+//        {
+//            killWinWordProcess();
+//            wordApp = new Application();
+//            wordApp.DisplayAlerts = WdAlertLevel.wdAlertsNone;
+//            wordApp.Visible = false;
+//            object missing = System.Reflection.Missing.Value;
+//            object templateName = filePath;
+//            wordDoc = wordApp.Documents.Open(ref templateName, ref missing,
+//            ref missing, ref missing, ref missing, ref missing, ref missing,
+//            ref missing, ref missing, ref missing, ref missing, ref missing,
+//            ref missing, ref missing, ref missing, ref missing);
+//        }
 
-        //保存新文件
-        public void SaveDocument(string filePath)
-        {
-            object fileName = filePath;
-            object format = WdSaveFormat.wdFormatDocument;//保存格式
-            object miss = System.Reflection.Missing.Value;
-            wordDoc.SaveAs(ref fileName, ref format, ref miss,
-            ref miss, ref miss, ref miss, ref miss,
-            ref miss, ref miss, ref miss, ref miss,
-            ref miss, ref miss, ref miss, ref miss,
-            ref miss);
-            //关闭wordDoc,wordApp对象
-            object SaveChanges = WdSaveOptions.wdSaveChanges;
-            object OriginalFormat = WdOriginalFormat.wdOriginalDocumentFormat;
-            object RouteDocument = false;
-            wordDoc.Close(ref SaveChanges, ref OriginalFormat, ref RouteDocument);
-            wordApp.Quit(ref SaveChanges, ref OriginalFormat, ref RouteDocument);
-        }
+//        //保存新文件
+//        public void SaveDocument(string filePath)
+//        {
+//            object fileName = filePath;
+//            object format = WdSaveFormat.wdFormatDocument;//保存格式
+//            object miss = System.Reflection.Missing.Value;
+//            wordDoc.SaveAs(ref fileName, ref format, ref miss,
+//            ref miss, ref miss, ref miss, ref miss,
+//            ref miss, ref miss, ref miss, ref miss,
+//            ref miss, ref miss, ref miss, ref miss,
+//            ref miss);
+//            //关闭wordDoc,wordApp对象
+//            object SaveChanges = WdSaveOptions.wdSaveChanges;
+//            object OriginalFormat = WdOriginalFormat.wdOriginalDocumentFormat;
+//            object RouteDocument = false;
+//            wordDoc.Close(ref SaveChanges, ref OriginalFormat, ref RouteDocument);
+//            wordApp.Quit(ref SaveChanges, ref OriginalFormat, ref RouteDocument);
+//        }
 
-        //在书签处插入值
-        public bool InsertValue(string bookmark, string value)
-        {
-            object bkObj = bookmark;
-            if (wordApp.ActiveDocument.Bookmarks.Exists(bookmark))
-            {
-                wordApp.ActiveDocument.Bookmarks.get_Item(ref bkObj).Select();
-                wordApp.Selection.TypeText(value);
-                return true;
-            }
-            return false;
-        }
+//        //在书签处插入值
+//        public bool InsertValue(string bookmark, string value)
+//        {
+//            object bkObj = bookmark;
+//            if (wordApp.ActiveDocument.Bookmarks.Exists(bookmark))
+//            {
+//                wordApp.ActiveDocument.Bookmarks.get_Item(ref bkObj).Select();
+//                wordApp.Selection.TypeText(value);
+//                return true;
+//            }
+//            return false;
+//        }
 
-        //插入表格,bookmark书签
-        public Table InsertTable(string bookmark, int rows, int columns, float width)
-        {
-            object miss = System.Reflection.Missing.Value;
-            object oStart = bookmark;
-            Range range = wordDoc.Bookmarks.get_Item(ref oStart).Range;//表格插入位置
-            Table newTable = wordDoc.Tables.Add(range, rows, columns, ref miss, ref miss);
-            //设置表的格式
-            newTable.Borders.Enable = 1; //允许有边框,默认没有边框(为0时报错,1为实线边框,2、3为虚线边框,以后的数字没试过)
-            newTable.Borders.OutsideLineWidth = WdLineWidth.wdLineWidth050pt;//边框宽度
-            if (width != 0)
-            {
-                newTable.PreferredWidth = width;//表格宽度
-            }
-            newTable.AllowPageBreaks = false;
-            return newTable;
-        }
+//        //插入表格,bookmark书签
+//        public Table InsertTable(string bookmark, int rows, int columns, float width)
+//        {
+//            object miss = System.Reflection.Missing.Value;
+//            object oStart = bookmark;
+//            Range range = wordDoc.Bookmarks.get_Item(ref oStart).Range;//表格插入位置
+//            Table newTable = wordDoc.Tables.Add(range, rows, columns, ref miss, ref miss);
+//            //设置表的格式
+//            newTable.Borders.Enable = 1; //允许有边框,默认没有边框(为0时报错,1为实线边框,2、3为虚线边框,以后的数字没试过)
+//            newTable.Borders.OutsideLineWidth = WdLineWidth.wdLineWidth050pt;//边框宽度
+//            if (width != 0)
+//            {
+//                newTable.PreferredWidth = width;//表格宽度
+//            }
+//            newTable.AllowPageBreaks = false;
+//            return newTable;
+//        }
 
-        //合并单元格 表名,开始行号,开始列号,结束行号,结束列号
-        public void MergeCell(Microsoft.Office.Interop.Word.Table table, int row1, int column1, int row2, int column2)
-        {
-            table.Cell(row1, column1).Merge(table.Cell(row2, column2));
-        }
+//        //合并单元格 表名,开始行号,开始列号,结束行号,结束列号
+//        public void MergeCell(Microsoft.Office.Interop.Word.Table table, int row1, int column1, int row2, int column2)
+//        {
+//            table.Cell(row1, column1).Merge(table.Cell(row2, column2));
+//        }
 
-        //设置表格内容对齐方式Align水平方向,Vertical垂直方向(左对齐,居中对齐,右对齐分别对应Align和Vertical的值为-1,0,1)
-        public void SetParagraph_Table(Microsoft.Office.Interop.Word.Table table, int Align, int Vertical)
-        {
-            switch (Align)
-            {
-                case -1:
-                    table.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLeft; break;//左对齐
-                    case0: table.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter; break;//水平居中
-                    case1: table.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight; break;//右对齐
-            }
-            switch (Vertical)
-            {
-                case -1:
-                    table.Range.Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalTop; break;//顶端对齐
-                    case0: table.Range.Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalCenter; break;//垂直居中
-                    case1: table.Range.Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalBottom; break;//底端对齐
-            }
-        }
+//        //设置表格内容对齐方式Align水平方向,Vertical垂直方向(左对齐,居中对齐,右对齐分别对应Align和Vertical的值为-1,0,1)
+//        public void SetParagraph_Table(Microsoft.Office.Interop.Word.Table table, int Align, int Vertical)
+//        {
+//            switch (Align)
+//            {
+//                case -1:
+//                    table.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLeft; break;//左对齐
+//                    case0: table.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter; break;//水平居中
+//                    case1: table.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight; break;//右对齐
+//            }
+//            switch (Vertical)
+//            {
+//                case -1:
+//                    table.Range.Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalTop; break;//顶端对齐
+//                    case0: table.Range.Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalCenter; break;//垂直居中
+//                    case1: table.Range.Cells.VerticalAlignment = WdCellVerticalAlignment.wdCellAlignVerticalBottom; break;//底端对齐
+//            }
+//        }
 
-        //设置表格字体
-        public void SetFont_Table(Microsoft.Office.Interop.Word.Table table, string fontName, double size)
-        {
-            if (size != 0)
-            {
-                table.Range.Font.Size = Convert.ToSingle(size);
-            }
-            if (fontName != "")
-            {
-                table.Range.Font.Name = fontName;
-            }
-        }
+//        //设置表格字体
+//        public void SetFont_Table(Microsoft.Office.Interop.Word.Table table, string fontName, double size)
+//        {
+//            if (size != 0)
+//            {
+//                table.Range.Font.Size = Convert.ToSingle(size);
+//            }
+//            if (fontName != "")
+//            {
+//                table.Range.Font.Name = fontName;
+//            }
+//        }
 
-        //是否使用边框,n表格的序号,use是或否
-        public void UseBorder(int n, bool use)
-        {
-            if (use)
-            {
-                wordDoc.Content.Tables[n].Borders.Enable = 1; //允许有边框,默认没有边框(为0时无边框,1为实线边框,2、3为虚线边框,以后的数字没试过)
-            }
-            else
-            {
-                wordDoc.Content.Tables[n].Borders.Enable = 2; //允许有边框,默认没有边框(为0时无边框,1为实线边框,2、3为虚线边框,以后的数字没试过)
-            }
-        }
-        //设置表格边框
-        public void UseBorder(int n, int type)
-        {
-            wordDoc.Content.Tables[n].Borders.Enable = type; //允许有边框,默认没有边框(为0时无边框,1为实线边框,2、3为虚线边框,以后的数字没试过)
-        }
+//        //是否使用边框,n表格的序号,use是或否
+//        public void UseBorder(int n, bool use)
+//        {
+//            if (use)
+//            {
+//                wordDoc.Content.Tables[n].Borders.Enable = 1; //允许有边框,默认没有边框(为0时无边框,1为实线边框,2、3为虚线边框,以后的数字没试过)
+//            }
+//            else
+//            {
+//                wordDoc.Content.Tables[n].Borders.Enable = 2; //允许有边框,默认没有边框(为0时无边框,1为实线边框,2、3为虚线边框,以后的数字没试过)
+//            }
+//        }
+//        //设置表格边框
+//        public void UseBorder(int n, int type)
+//        {
+//            wordDoc.Content.Tables[n].Borders.Enable = type; //允许有边框,默认没有边框(为0时无边框,1为实线边框,2、3为虚线边框,以后的数字没试过)
+//        }
 
-        //给表格插入一行,n表格的序号从1开始记
-        public void AddRow(int n)
-        {
-            object miss = System.Reflection.Missing.Value;
-            wordDoc.Content.Tables[n].Rows.Add(ref miss);
-        }
+//        //给表格插入一行,n表格的序号从1开始记
+//        public void AddRow(int n)
+//        {
+//            object miss = System.Reflection.Missing.Value;
+//            wordDoc.Content.Tables[n].Rows.Add(ref miss);
+//        }
 
-        //给表格添加一行
-        public void AddRow(Microsoft.Office.Interop.Word.Table table)
-        {
-            object miss = System.Reflection.Missing.Value;
-            table.Rows.Add(ref miss);
-        }
+//        //给表格添加一行
+//        public void AddRow(Microsoft.Office.Interop.Word.Table table)
+//        {
+//            object miss = System.Reflection.Missing.Value;
+//            table.Rows.Add(ref miss);
+//        }
 
-        //给表格插入rows行,n为表格的序号
-        public void AddRow(int n, int rows)
-        {
-            object miss = System.Reflection.Missing.Value;
-            Microsoft.Office.Interop.Word.Table table = wordDoc.Content.Tables[n];
-            for (int i = 0; i < rows; i++)
-            {
-                table.Rows.Add(ref miss);
-            }
-        }
+//        //给表格插入rows行,n为表格的序号
+//        public void AddRow(int n, int rows)
+//        {
+//            object miss = System.Reflection.Missing.Value;
+//            Microsoft.Office.Interop.Word.Table table = wordDoc.Content.Tables[n];
+//            for (int i = 0; i < rows; i++)
+//            {
+//                table.Rows.Add(ref miss);
+//            }
+//        }
 
-        //给表格中单元格插入元素,table所在表格,row行号,column列号,value插入的元素
-        public void InsertCell(Microsoft.Office.Interop.Word.Table table, int row, int column, string value)
-        {
-            table.Cell(row, column).Range.Text = value;
-        }
+//        //给表格中单元格插入元素,table所在表格,row行号,column列号,value插入的元素
+//        public void InsertCell(Microsoft.Office.Interop.Word.Table table, int row, int column, string value)
+//        {
+//            table.Cell(row, column).Range.Text = value;
+//        }
 
-        //给表格中单元格插入元素,n表格的序号从1开始记,row行号,column列号,value插入的元素
-        public void InsertCell(int n, int row, int column, string value)
-        {
-            wordDoc.Content.Tables[n].Cell(row, column).Range.Text = value;
-        }
+//        //给表格中单元格插入元素,n表格的序号从1开始记,row行号,column列号,value插入的元素
+//        public void InsertCell(int n, int row, int column, string value)
+//        {
+//            wordDoc.Content.Tables[n].Cell(row, column).Range.Text = value;
+//        }
 
-        //给表格插入一行数据,n为表格的序号,row行号,columns列数,values插入的值
-        public void InsertCell(int n, int row, int columns, string[] values)
-        {
-            Microsoft.Office.Interop.Word.Table table = wordDoc.Content.Tables[n];
-            for (int i = 0; i < columns; i++)
-            {
-                table.Cell(row, i + 1).Range.Text = values[i];
-            }
-        }
+//        //给表格插入一行数据,n为表格的序号,row行号,columns列数,values插入的值
+//        public void InsertCell(int n, int row, int columns, string[] values)
+//        {
+//            Microsoft.Office.Interop.Word.Table table = wordDoc.Content.Tables[n];
+//            for (int i = 0; i < columns; i++)
+//            {
+//                table.Cell(row, i + 1).Range.Text = values[i];
+//            }
+//        }
 
-        //插入图片
-        public void InsertPicture(string bookmark, string picturePath, float width, float hight)
-        {
-            object miss = System.Reflection.Missing.Value;
-            object oStart = bookmark;
-            Object linkToFile = false; //图片是否为外部链接
-            Object saveWithDocument = true; //图片是否随文档一起保存
-            object range = wordDoc.Bookmarks.get_Item(ref oStart).Range;//图片插入位置
-            wordDoc.InlineShapes.AddPicture(picturePath, ref linkToFile, ref saveWithDocument, ref range);
-            wordDoc.Application.ActiveDocument.InlineShapes[1].Width = width; //设置图片宽度
-            wordDoc.Application.ActiveDocument.InlineShapes[1].Height = hight; //设置图片高度
-        }
+//        //插入图片
+//        public void InsertPicture(string bookmark, string picturePath, float width, float hight)
+//        {
+//            object miss = System.Reflection.Missing.Value;
+//            object oStart = bookmark;
+//            Object linkToFile = false; //图片是否为外部链接
+//            Object saveWithDocument = true; //图片是否随文档一起保存
+//            object range = wordDoc.Bookmarks.get_Item(ref oStart).Range;//图片插入位置
+//            wordDoc.InlineShapes.AddPicture(picturePath, ref linkToFile, ref saveWithDocument, ref range);
+//            wordDoc.Application.ActiveDocument.InlineShapes[1].Width = width; //设置图片宽度
+//            wordDoc.Application.ActiveDocument.InlineShapes[1].Height = hight; //设置图片高度
+//        }
 
-        //在表格中插入图片-Y
-        public void InsertCell(Microsoft.Office.Interop.Word.Table table, int row, int column, string picturePath, float width, float hight, int idx)
-        {
-            Object linkToFile = false; //图片是否为外部链接
-            Object saveWithDocument = true; //图片是否随文档一起保存
-            object range = table.Cell(row, column).Range;//图片插入位置
-            wordDoc.InlineShapes.AddPicture(picturePath, ref linkToFile, ref saveWithDocument, ref range);
-            wordDoc.Application.ActiveDocument.InlineShapes[idx].Width = width; //设置图片宽度
-            wordDoc.Application.ActiveDocument.InlineShapes[idx].Height = hight; //设置图片高度
-        }
+//        //在表格中插入图片-Y
+//        public void InsertCell(Microsoft.Office.Interop.Word.Table table, int row, int column, string picturePath, float width, float hight, int idx)
+//        {
+//            Object linkToFile = false; //图片是否为外部链接
+//            Object saveWithDocument = true; //图片是否随文档一起保存
+//            object range = table.Cell(row, column).Range;//图片插入位置
+//            wordDoc.InlineShapes.AddPicture(picturePath, ref linkToFile, ref saveWithDocument, ref range);
+//            wordDoc.Application.ActiveDocument.InlineShapes[idx].Width = width; //设置图片宽度
+//            wordDoc.Application.ActiveDocument.InlineShapes[idx].Height = hight; //设置图片高度
+//        }
 
-        //插入一段文字,text为文字内容
-        public void InsertText(string bookmark, string text)
-        {
-            object oStart = bookmark;
-            object range = wordDoc.Bookmarks.get_Item(ref oStart).Range;
-            Paragraph wp = wordDoc.Content.Paragraphs.Add(ref range);
-            wp.Format.SpaceBefore = 6;
-            wp.Range.Text = text;
-            wp.Format.SpaceAfter = 24;
-            wp.Range.InsertParagraphAfter();
-            wordDoc.Paragraphs.Last.Range.Text = "\n";
-        }
+//        //插入一段文字,text为文字内容
+//        public void InsertText(string bookmark, string text)
+//        {
+//            object oStart = bookmark;
+//            object range = wordDoc.Bookmarks.get_Item(ref oStart).Range;
+//            Paragraph wp = wordDoc.Content.Paragraphs.Add(ref range);
+//            wp.Format.SpaceBefore = 6;
+//            wp.Range.Text = text;
+//            wp.Format.SpaceAfter = 24;
+//            wp.Range.InsertParagraphAfter();
+//            wordDoc.Paragraphs.Last.Range.Text = "\n";
+//        }
 
-        //杀掉winword.exe进程
-        public void killWinWordProcess()
-        {
-            System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("WINWORD");
-            foreach (System.Diagnostics.Process process in processes)
-            {
-                bool b = process.MainWindowTitle == "";
-                if (process.MainWindowTitle == "")
-                {
-                    process.Kill();
-                }
-            }
-        }
-    }
-}
+//        //杀掉winword.exe进程
+//        public void killWinWordProcess()
+//        {
+//            System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("WINWORD");
+//            foreach (System.Diagnostics.Process process in processes)
+//            {
+//                bool b = process.MainWindowTitle == "";
+//                if (process.MainWindowTitle == "")
+//                {
+//                    process.Kill();
+//                }
+//            }
+//        }
+//    }
+//}

+ 58 - 58
Fork.Net/Y.Utils/Test/WordToolTester.cs

@@ -1,58 +1,58 @@
-//############################################################
-//      https://github.com/yuzhengyang
-//      author:yuzhengyang
-//############################################################
-using Microsoft.Office.Interop.Word;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Y.Utils.IOUtils.OfficeUtils;
-
-namespace Y.Utils.Test
-{
-    class WordToolTester
-    {
-        static void Main(string[] args)
-        {
-            int tsize = 5;
-            List<Dictionary<string, object>> test = new List<Dictionary<string, object>>();
-            for (int i = 0; i < 10; i++)
-            {
-                Dictionary<string, object> q = new Dictionary<string, object>();
-                q.Add("title", string.Format("第{0}题:{0}{0}{0}{0}", i));
-                q.Add("content", "长期从事电脑操作者,应多吃一些新鲜的蔬菜和水果,同时增加维生素A、B1、C、E的摄入。为预防角膜干燥、眼干涩、视力下降、甚至出现夜盲等,电 脑操作者应多吃富含维生素A的食物,如豆制品、鱼、牛奶、核桃、青菜、大白菜、空心菜、西红柿及新鲜水果等。");
-                q.Add("image", @"C:\Users\Administrator\Pictures\1.jpg");
-                test.Add(q);
-            }
-
-            WordTool report = new WordTool();
-            report.CreateNewDocument(@"F:\模板1.docx"); //模板路径
-            report.InsertValue("name", "测试考试");//在书签“Bookmark_value”处插入值
-            Table table = report.InsertTable("content", test.Count() * tsize, 1, 0); //在书签“Bookmark_table”处插入2行3列行宽最大的表
-            report.UseBorder(1, 0); //模板中第一个表格使用实线边框
-
-            for (int i = 0; i < test.Count(); i++)
-            {
-
-
-                //string picturePath = t["image"].ToString();
-                //report.InsertPicture("content", picturePath, 150, 150); //书签位置,图片路径,图片宽度,图片高度
-
-                //string content = t["content"].ToString();
-                //report.InsertText("content", content);
-
-                //string title = t["title"].ToString();
-                //report.InsertText("content", title);
-
-                report.InsertCell(table, 1 + (i * tsize), 1, test[i]["title"].ToString());//表名,行号,列号,值
-                report.InsertCell(table, 2 + (i * tsize), 1, test[i]["content"].ToString());//表名,行号,列号,值
-                report.InsertCell(table, 3 + (i * tsize), 1, test[i]["image"].ToString(), 150, 150, i + 1);//表名,行号,列号,值
-
-            }
-
-            report.SaveDocument(@"F:\doc1.doc"); //文档路径
-            Console.WriteLine("please input enter to exit.");
-            Console.ReadLine();
-        }
-    }
-}
+////############################################################
+////      https://github.com/yuzhengyang
+////      author:yuzhengyang
+////############################################################
+//using Microsoft.Office.Interop.Word;
+//using System;
+//using System.Collections.Generic;
+//using System.Linq;
+//using Y.Utils.IOUtils.OfficeUtils;
+
+//namespace Y.Utils.Test
+//{
+//    class WordToolTester
+//    {
+//        static void Main(string[] args)
+//        {
+//            int tsize = 5;
+//            List<Dictionary<string, object>> test = new List<Dictionary<string, object>>();
+//            for (int i = 0; i < 10; i++)
+//            {
+//                Dictionary<string, object> q = new Dictionary<string, object>();
+//                q.Add("title", string.Format("第{0}题:{0}{0}{0}{0}", i));
+//                q.Add("content", "长期从事电脑操作者,应多吃一些新鲜的蔬菜和水果,同时增加维生素A、B1、C、E的摄入。为预防角膜干燥、眼干涩、视力下降、甚至出现夜盲等,电 脑操作者应多吃富含维生素A的食物,如豆制品、鱼、牛奶、核桃、青菜、大白菜、空心菜、西红柿及新鲜水果等。");
+//                q.Add("image", @"C:\Users\Administrator\Pictures\1.jpg");
+//                test.Add(q);
+//            }
+
+//            WordTool report = new WordTool();
+//            report.CreateNewDocument(@"F:\模板1.docx"); //模板路径
+//            report.InsertValue("name", "测试考试");//在书签“Bookmark_value”处插入值
+//            Table table = report.InsertTable("content", test.Count() * tsize, 1, 0); //在书签“Bookmark_table”处插入2行3列行宽最大的表
+//            report.UseBorder(1, 0); //模板中第一个表格使用实线边框
+
+//            for (int i = 0; i < test.Count(); i++)
+//            {
+
+
+//                //string picturePath = t["image"].ToString();
+//                //report.InsertPicture("content", picturePath, 150, 150); //书签位置,图片路径,图片宽度,图片高度
+
+//                //string content = t["content"].ToString();
+//                //report.InsertText("content", content);
+
+//                //string title = t["title"].ToString();
+//                //report.InsertText("content", title);
+
+//                report.InsertCell(table, 1 + (i * tsize), 1, test[i]["title"].ToString());//表名,行号,列号,值
+//                report.InsertCell(table, 2 + (i * tsize), 1, test[i]["content"].ToString());//表名,行号,列号,值
+//                report.InsertCell(table, 3 + (i * tsize), 1, test[i]["image"].ToString(), 150, 150, i + 1);//表名,行号,列号,值
+
+//            }
+
+//            report.SaveDocument(@"F:\doc1.doc"); //文档路径
+//            Console.WriteLine("please input enter to exit.");
+//            Console.ReadLine();
+//        }
+//    }
+//}

+ 10 - 4
Fork.Net/Y.Utils/WindowsUtils/InfoUtils/RegisterTool.cs

@@ -1,12 +1,18 @@
-//############################################################
+//************************************************************************
 //      https://github.com/yuzhengyang
-//      author:yuzhengyang
-//############################################################
+//      author:     yuzhengyang
+//      date:       2017.3.29 - 2017.6.13
+//      desc:       注册表操作工具
+//      Copyright (c) yuzhengyang. All rights reserved.
+//************************************************************************
 using Microsoft.Win32;
 using System;
 
 namespace Y.Utils.WindowsUtils.InfoUtils
 {
+    /// <summary>
+    /// 注册表操作工具
+    /// </summary>
     public class RegisterTool
     {
         [Obsolete]
@@ -78,7 +84,7 @@ namespace Y.Utils.WindowsUtils.InfoUtils
             }
         }
         /// <summary>
-        /// 删除注册表值
+        /// 读取注册表值
         /// </summary>
         /// <param name="key"></param>
         /// <param name="name"></param>

+ 0 - 3
Fork.Net/Y.Utils/Y.Utils.csproj

@@ -34,9 +34,6 @@
     <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
-      <EmbedInteropTypes>True</EmbedInteropTypes>
-    </Reference>
     <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
       <Private>True</Private>