Ejemplo n.º 1
0
        internal static string GetInnerTemplatesFingerPrint(string zipProvider)
        {
            StringBuilder sb  = new StringBuilder();
            SHA1          sha = new SHA1CryptoServiceProvider();

            byte[] hash = null;
            try
            {
                System.Reflection.Assembly a  = System.Reflection.Assembly.GetExecutingAssembly();
                ResourceManager            rm = new ResourceManager("netz.starter.starter", a);
                byte[] data = (byte[])rm.GetObject("data");
                hash = sha.ComputeHash(data);
                sb.Append("Starter ID: ").Append(Byte2HexString(hash)).Append(Environment.NewLine);
            }
            catch (Exception ex01)
            {
                sb.Append("Starter ID: ").Append(ex01.Message).Append(Environment.NewLine);
            }
            try
            {
                CompressProvider cp = new CompressProvider(zipProvider);
                if (cp == null)
                {
                    throw new Exception("No Compression Provider");
                }
                try
                {
                    string temp = cp.Provider.GetHeadTemplate();
                    if (temp != null)
                    {
                        hash = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(temp));
                        sb.Append(zipProvider).Append(".head ID: ").Append(Byte2HexString(hash)).Append(Environment.NewLine);
                    }
                }
                catch (Exception ex02)
                {
                    sb.Append(zipProvider).Append(".head ID: ").Append(ex02.Message).Append(Environment.NewLine);
                }
                try
                {
                    string temp = cp.Provider.GetBodyTemplate();
                    if (temp != null)
                    {
                        hash = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(temp));
                        sb.Append(zipProvider).Append(".body ID: ").Append(Byte2HexString(hash)).Append(Environment.NewLine);
                    }
                }
                catch (Exception ex03)
                {
                    sb.Append(zipProvider).Append(".body ID: ").Append(ex03.Message).Append(Environment.NewLine);
                }
            }
            catch (Exception ex04)
            {
                sb.Append(zipProvider).Append(" ID: ").Append(ex04.Message).Append(Environment.NewLine);
            }
            return(sb.ToString());
        }
		internal static string GetInnerTemplatesFingerPrint(string zipProvider)
		{
			StringBuilder sb = new StringBuilder();
			SHA1 sha = new SHA1CryptoServiceProvider();
			byte[] hash = null;
			try
			{
				System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
				ResourceManager rm = new ResourceManager("netz.starter.starter", a);
				byte[] data = (byte[])rm.GetObject("data");
				hash = sha.ComputeHash(data);
				sb.Append("Starter ID: ").Append(Byte2HexString(hash)).Append(Environment.NewLine);
			}
			catch(Exception ex01)
			{
				sb.Append("Starter ID: ").Append(ex01.Message).Append(Environment.NewLine);
			}
			try
			{
				CompressProvider cp = new CompressProvider(zipProvider);
				if(cp == null) throw new Exception("No Compression Provider");
				try
				{
					string temp = cp.Provider.GetHeadTemplate();
					if(temp != null)
					{
						hash = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(temp));
						sb.Append(zipProvider).Append(".head ID: ").Append(Byte2HexString(hash)).Append(Environment.NewLine);
					}
				}
				catch(Exception ex02)
				{
					sb.Append(zipProvider).Append(".head ID: ").Append(ex02.Message).Append(Environment.NewLine);
				}
				try
				{
					string temp = cp.Provider.GetBodyTemplate();
					if(temp != null)
					{
						hash = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(temp));
						sb.Append(zipProvider).Append(".body ID: ").Append(Byte2HexString(hash)).Append(Environment.NewLine);
					}
				}
				catch(Exception ex03)
				{
					sb.Append(zipProvider).Append(".body ID: ").Append(ex03.Message).Append(Environment.NewLine);
				}
			}
			catch(Exception ex04)
			{
				sb.Append(zipProvider).Append(" ID: ").Append(ex04.Message).Append(Environment.NewLine);
			}
			return sb.ToString();
		}