Initial commit
This commit is contained in:
commit
19280aa68e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class Class1
|
||||||
|
{
|
||||||
|
public Class1()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 15
|
||||||
|
VisualStudioVersion = 15.0.27004.2002
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "crypto", "crypto\crypto.csproj", "{27673584-A7C4-4D51-A966-16478D509B77}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{27673584-A7C4-4D51-A966-16478D509B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{27673584-A7C4-4D51-A966-16478D509B77}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{27673584-A7C4-4D51-A966-16478D509B77}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{27673584-A7C4-4D51-A966-16478D509B77}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {544B8034-D08F-471C-B833-E3E3D88984DF}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,103 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
class AES_CRYPTO
|
||||||
|
{
|
||||||
|
private static readonly byte[] SALT = new byte[] { 0x26, 0xdc, 0xff, 0x00, 0xad, 0xed, 0x7a, 0xee, 0xc5, 0xfe, 0x07, 0xaf, 0x4d, 0x08, 0x22, 0x3c };
|
||||||
|
public AES_CRYPTO()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public string Crypt(string text, string key)
|
||||||
|
{
|
||||||
|
return EncryptString(text, key, "");
|
||||||
|
}
|
||||||
|
public string decryptage(string text, string key)
|
||||||
|
{
|
||||||
|
return DecryptString(text, key, "");
|
||||||
|
}
|
||||||
|
private static string EncryptString(string clearText, string strKey, string strIv)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Place le texte à chiffrer dans un tableau d'octets
|
||||||
|
byte[] plainText = Encoding.UTF8.GetBytes(clearText);
|
||||||
|
|
||||||
|
// Place la clé de chiffrement dans un tableau d'octets
|
||||||
|
byte[] key = Encoding.UTF8.GetBytes(strKey);
|
||||||
|
|
||||||
|
// Place le vecteur d'initialisation dans un tableau d'octets
|
||||||
|
byte[] iv = Encoding.UTF8.GetBytes(strIv);
|
||||||
|
|
||||||
|
|
||||||
|
RijndaelManaged rijndael = new RijndaelManaged();
|
||||||
|
MD5 md5 = MD5.Create();
|
||||||
|
// Définit le mode utilisé
|
||||||
|
rijndael.Mode = CipherMode.CBC;
|
||||||
|
rijndael.Key = md5.ComputeHash(key);
|
||||||
|
rijndael.IV = md5.ComputeHash(key);
|
||||||
|
// Crée le chiffreur AES - Rijndael
|
||||||
|
ICryptoTransform aesEncryptor = rijndael.CreateEncryptor();
|
||||||
|
|
||||||
|
MemoryStream ms = new MemoryStream();
|
||||||
|
|
||||||
|
// Ecris les données chiffrées dans le MemoryStream
|
||||||
|
CryptoStream cs = new CryptoStream(ms, aesEncryptor, CryptoStreamMode.Write);
|
||||||
|
cs.Write(plainText, 0, plainText.Length);
|
||||||
|
cs.FlushFinalBlock();
|
||||||
|
|
||||||
|
|
||||||
|
// Place les données chiffrées dans un tableau d'octet
|
||||||
|
byte[] CipherBytes = ms.ToArray();
|
||||||
|
|
||||||
|
|
||||||
|
ms.Close();
|
||||||
|
cs.Close();
|
||||||
|
|
||||||
|
// Place les données chiffrées dans une chaine encodée en Base64
|
||||||
|
return Convert.ToBase64String(CipherBytes);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string DecryptString(string cipherText, string strKey, string strIv)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Place le texte à déchiffrer dans un tableau d'octets
|
||||||
|
byte[] cipheredData = Convert.FromBase64String(cipherText);
|
||||||
|
|
||||||
|
// Place la clé de déchiffrement dans un tableau d'octets
|
||||||
|
byte[] key = Encoding.UTF8.GetBytes(strKey);
|
||||||
|
|
||||||
|
// Place le vecteur d'initialisation dans un tableau d'octets
|
||||||
|
byte[] iv = Encoding.UTF8.GetBytes(strIv);
|
||||||
|
MD5 md5 = MD5.Create();
|
||||||
|
RijndaelManaged rijndael = new RijndaelManaged();
|
||||||
|
rijndael.Key = md5.ComputeHash(key);
|
||||||
|
rijndael.IV = md5.ComputeHash(key);
|
||||||
|
|
||||||
|
|
||||||
|
// Ecris les données déchiffrées dans le MemoryStream
|
||||||
|
ICryptoTransform decryptor = rijndael.CreateDecryptor();
|
||||||
|
MemoryStream ms = new MemoryStream(cipheredData);
|
||||||
|
CryptoStream cs = new CryptoStream(ms, decryptor, CryptoStreamMode.Read);
|
||||||
|
|
||||||
|
// Place les données déchiffrées dans un tableau d'octet
|
||||||
|
byte[] plainTextData = new byte[cipheredData.Length];
|
||||||
|
|
||||||
|
int decryptedByteCount = cs.Read(plainTextData, 0, plainTextData.Length);
|
||||||
|
|
||||||
|
ms.Close();
|
||||||
|
cs.Close();
|
||||||
|
|
||||||
|
return Encoding.UTF8.GetString(plainTextData, 0, decryptedByteCount);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,94 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
class CryptoPerso
|
||||||
|
{
|
||||||
|
//Basé sur le cryptage césar
|
||||||
|
private const string alphabet = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789&@,?;.:/ ";
|
||||||
|
public string Alphabet { get { return alphabet; } set { } }
|
||||||
|
private byte[] alphabetArray = Encoding.ASCII.GetBytes(alphabet);
|
||||||
|
private byte[] textArray;
|
||||||
|
|
||||||
|
|
||||||
|
public CryptoPerso()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] StrToInt(string texte)
|
||||||
|
{
|
||||||
|
List<byte> tmp = new List<byte>();
|
||||||
|
textArray = Encoding.ASCII.GetBytes(texte);
|
||||||
|
for(int i=0; i<textArray.Length;i++)
|
||||||
|
{
|
||||||
|
byte j;
|
||||||
|
for (j = 0; textArray[i] != alphabetArray[j] && j < alphabetArray.Length; j++);
|
||||||
|
tmp.Add(j);
|
||||||
|
}
|
||||||
|
return tmp.ToArray();
|
||||||
|
}
|
||||||
|
public byte[] IntToStr(byte[] textArray)
|
||||||
|
{
|
||||||
|
List<byte> tmp = new List<byte>();
|
||||||
|
for (int i = 0; i < textArray.Length; i++)
|
||||||
|
{
|
||||||
|
tmp.Add(alphabetArray[textArray[i]]);
|
||||||
|
}
|
||||||
|
return tmp.ToArray();
|
||||||
|
}
|
||||||
|
public string Crypt(string texte, string pw)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] texteInt = StrToInt(texte);
|
||||||
|
byte[] pwInt = StrToInt(pw);
|
||||||
|
List<byte> tmp = new List<byte>();
|
||||||
|
for (int i = 0; i < texteInt.Length; i++)
|
||||||
|
{
|
||||||
|
byte a = (byte)((texteInt[i] + pwInt[i % (pwInt.Length)]) % (alphabetArray.Length));
|
||||||
|
tmp.Add(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Encoding.ASCII.GetString(IntToStr(tmp.ToArray()));
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
warn w = new warn("ERREUR : "+e.ToString());
|
||||||
|
w.Show();
|
||||||
|
Console.WriteLine(e.ToString());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string decryptage(string texte, string pw)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] texteInt = StrToInt(texte);
|
||||||
|
byte[] pwInt = StrToInt(pw);
|
||||||
|
List<byte> tmp = new List<byte>();
|
||||||
|
for (int i = 0; i < texteInt.Length; i++)
|
||||||
|
{
|
||||||
|
if (texteInt[i] < pwInt[i % (pwInt.Length)])
|
||||||
|
texteInt[i] += (byte)(alphabet.Length);
|
||||||
|
byte a = (byte)((texteInt[i] - pwInt[i % (pwInt.Length)]));
|
||||||
|
tmp.Add(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Encoding.ASCII.GetString(IntToStr(tmp.ToArray()));
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
warn w = new warn("ERREUR : "+e.ToString());
|
||||||
|
w.Show();
|
||||||
|
Console.WriteLine(e.ToString());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,171 @@
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Variable nécessaire au concepteur.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nettoyage des ressources utilisées.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Code généré par le Concepteur Windows Form
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
|
||||||
|
/// le contenu de cette méthode avec l'éditeur de code.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.ftb_origine = new System.Windows.Forms.TextBox();
|
||||||
|
this.ftb_traiter = new System.Windows.Forms.TextBox();
|
||||||
|
this.ftb_clef = new System.Windows.Forms.TextBox();
|
||||||
|
this.fcb_typeCrypto = new System.Windows.Forms.ComboBox();
|
||||||
|
this.fbt_cryptage = new System.Windows.Forms.Button();
|
||||||
|
this.fbt_decrypter = new System.Windows.Forms.Button();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// ftb_origine
|
||||||
|
//
|
||||||
|
this.ftb_origine.ForeColor = System.Drawing.Color.Gray;
|
||||||
|
this.ftb_origine.Location = new System.Drawing.Point(118, 12);
|
||||||
|
this.ftb_origine.Name = "ftb_origine";
|
||||||
|
this.ftb_origine.Size = new System.Drawing.Size(415, 20);
|
||||||
|
this.ftb_origine.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// ftb_traiter
|
||||||
|
//
|
||||||
|
this.ftb_traiter.ForeColor = System.Drawing.Color.Gray;
|
||||||
|
this.ftb_traiter.Location = new System.Drawing.Point(118, 149);
|
||||||
|
this.ftb_traiter.Name = "ftb_traiter";
|
||||||
|
this.ftb_traiter.Size = new System.Drawing.Size(415, 20);
|
||||||
|
this.ftb_traiter.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// ftb_clef
|
||||||
|
//
|
||||||
|
this.ftb_clef.Location = new System.Drawing.Point(118, 38);
|
||||||
|
this.ftb_clef.Name = "ftb_clef";
|
||||||
|
this.ftb_clef.Size = new System.Drawing.Size(415, 20);
|
||||||
|
this.ftb_clef.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// fcb_typeCrypto
|
||||||
|
//
|
||||||
|
this.fcb_typeCrypto.FormattingEnabled = true;
|
||||||
|
this.fcb_typeCrypto.Location = new System.Drawing.Point(118, 64);
|
||||||
|
this.fcb_typeCrypto.Name = "fcb_typeCrypto";
|
||||||
|
this.fcb_typeCrypto.Size = new System.Drawing.Size(415, 21);
|
||||||
|
this.fcb_typeCrypto.TabIndex = 4;
|
||||||
|
//this.fcb_typeCrypto;
|
||||||
|
//
|
||||||
|
// fbt_cryptage
|
||||||
|
//
|
||||||
|
this.fbt_cryptage.Location = new System.Drawing.Point(12, 91);
|
||||||
|
this.fbt_cryptage.Name = "fbt_cryptage";
|
||||||
|
this.fbt_cryptage.Size = new System.Drawing.Size(521, 23);
|
||||||
|
this.fbt_cryptage.TabIndex = 5;
|
||||||
|
this.fbt_cryptage.Text = "Crypter";
|
||||||
|
this.fbt_cryptage.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// fbt_decrypter
|
||||||
|
//
|
||||||
|
this.fbt_decrypter.Location = new System.Drawing.Point(12, 120);
|
||||||
|
this.fbt_decrypter.Name = "fbt_decrypter";
|
||||||
|
this.fbt_decrypter.Size = new System.Drawing.Size(521, 23);
|
||||||
|
this.fbt_decrypter.TabIndex = 6;
|
||||||
|
this.fbt_decrypter.Text = "Decrypter";
|
||||||
|
this.fbt_decrypter.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(16, 19);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(76, 13);
|
||||||
|
this.label1.TabIndex = 7;
|
||||||
|
this.label1.Text = "Text d\'origine :";
|
||||||
|
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(16, 45);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(31, 13);
|
||||||
|
this.label2.TabIndex = 8;
|
||||||
|
this.label2.Text = "Clef :";
|
||||||
|
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(16, 72);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(96, 13);
|
||||||
|
this.label3.TabIndex = 9;
|
||||||
|
this.label3.Text = "Type de cryptage :";
|
||||||
|
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(19, 155);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(67, 13);
|
||||||
|
this.label4.TabIndex = 10;
|
||||||
|
this.label4.Text = "Text Traiter :";
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1077, 357);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.fbt_decrypter);
|
||||||
|
this.Controls.Add(this.fbt_cryptage);
|
||||||
|
this.Controls.Add(this.fcb_typeCrypto);
|
||||||
|
this.Controls.Add(this.ftb_clef);
|
||||||
|
this.Controls.Add(this.ftb_traiter);
|
||||||
|
this.Controls.Add(this.ftb_origine);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Crypto";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.TextBox ftb_origine;
|
||||||
|
private System.Windows.Forms.TextBox ftb_traiter;
|
||||||
|
private System.Windows.Forms.TextBox ftb_clef;
|
||||||
|
private System.Windows.Forms.ComboBox fcb_typeCrypto;
|
||||||
|
private System.Windows.Forms.Button fbt_cryptage;
|
||||||
|
private System.Windows.Forms.Button fbt_decrypter;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,202 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Variable nécessaire au concepteur.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nettoyage des ressources utilisées.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Code généré par le Concepteur Windows Form
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
|
||||||
|
/// le contenu de cette méthode avec l'éditeur de code.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
|
this.ftb_origine = new System.Windows.Forms.TextBox();
|
||||||
|
this.ftb_clef = new System.Windows.Forms.TextBox();
|
||||||
|
this.fcb_typeCrypto = new System.Windows.Forms.ComboBox();
|
||||||
|
this.fbt_cryptage = new System.Windows.Forms.Button();
|
||||||
|
this.fbt_decrypter = new System.Windows.Forms.Button();
|
||||||
|
this.ftb_traiter = new System.Windows.Forms.TextBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// ftb_origine
|
||||||
|
//
|
||||||
|
this.ftb_origine.Location = new System.Drawing.Point(118, 12);
|
||||||
|
this.ftb_origine.Name = "ftb_origine";
|
||||||
|
this.ftb_origine.Size = new System.Drawing.Size(415, 20);
|
||||||
|
this.ftb_origine.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// ftb_clef
|
||||||
|
//
|
||||||
|
this.ftb_clef.Location = new System.Drawing.Point(118, 38);
|
||||||
|
this.ftb_clef.Name = "ftb_clef";
|
||||||
|
this.ftb_clef.Size = new System.Drawing.Size(415, 20);
|
||||||
|
this.ftb_clef.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// fcb_typeCrypto
|
||||||
|
//
|
||||||
|
this.fcb_typeCrypto.FormattingEnabled = true;
|
||||||
|
this.fcb_typeCrypto.Items.AddRange(new object[] {
|
||||||
|
"Dot Net",
|
||||||
|
"PERSO",
|
||||||
|
"wubba lubba dub dub"});
|
||||||
|
this.fcb_typeCrypto.Location = new System.Drawing.Point(118, 64);
|
||||||
|
this.fcb_typeCrypto.Name = "fcb_typeCrypto";
|
||||||
|
this.fcb_typeCrypto.Size = new System.Drawing.Size(415, 21);
|
||||||
|
this.fcb_typeCrypto.TabIndex = 4;
|
||||||
|
this.fcb_typeCrypto.SelectedIndexChanged += new System.EventHandler(this.fcb_typeCrypto_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// fbt_cryptage
|
||||||
|
//
|
||||||
|
this.fbt_cryptage.Location = new System.Drawing.Point(19, 91);
|
||||||
|
this.fbt_cryptage.Name = "fbt_cryptage";
|
||||||
|
this.fbt_cryptage.Size = new System.Drawing.Size(514, 23);
|
||||||
|
this.fbt_cryptage.TabIndex = 5;
|
||||||
|
this.fbt_cryptage.Text = "Crypter";
|
||||||
|
this.fbt_cryptage.UseVisualStyleBackColor = true;
|
||||||
|
this.fbt_cryptage.Click += new System.EventHandler(this.fbt_cryptage_Click);
|
||||||
|
//
|
||||||
|
// fbt_decrypter
|
||||||
|
//
|
||||||
|
this.fbt_decrypter.Location = new System.Drawing.Point(19, 120);
|
||||||
|
this.fbt_decrypter.Name = "fbt_decrypter";
|
||||||
|
this.fbt_decrypter.Size = new System.Drawing.Size(514, 23);
|
||||||
|
this.fbt_decrypter.TabIndex = 6;
|
||||||
|
this.fbt_decrypter.Text = "Decrypter";
|
||||||
|
this.fbt_decrypter.UseVisualStyleBackColor = true;
|
||||||
|
this.fbt_decrypter.Click += new System.EventHandler(this.fbt_decrypter_Click);
|
||||||
|
//
|
||||||
|
// ftb_traiter
|
||||||
|
//
|
||||||
|
|
||||||
|
this.ftb_traiter.Location = new System.Drawing.Point(118, 149);
|
||||||
|
this.ftb_traiter.Name = "ftb_traiter";
|
||||||
|
this.ftb_traiter.Size = new System.Drawing.Size(415, 20);
|
||||||
|
this.ftb_traiter.TabIndex = 15;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(19, 15);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(76, 13);
|
||||||
|
this.label1.TabIndex = 7;
|
||||||
|
this.label1.Text = "Text d\'origine :";
|
||||||
|
this.label1.Click += new System.EventHandler(this.label1_Click);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(19, 41);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(31, 13);
|
||||||
|
this.label2.TabIndex = 8;
|
||||||
|
this.label2.Text = "Clef :";
|
||||||
|
this.label2.Click += new System.EventHandler(this.label2_Click);
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(19, 67);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(96, 13);
|
||||||
|
this.label3.TabIndex = 9;
|
||||||
|
this.label3.Text = "Type de cryptage :";
|
||||||
|
this.label3.Click += new System.EventHandler(this.label3_Click);
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(19, 152);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(67, 13);
|
||||||
|
this.label4.TabIndex = 10;
|
||||||
|
this.label4.Text = "Text Traiter :";
|
||||||
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(19, 188);
|
||||||
|
this.pictureBox1.MaximumSize = new System.Drawing.Size(514, 250);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(514, 250);
|
||||||
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||||
|
this.pictureBox1.TabIndex = 11;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// timer1
|
||||||
|
//
|
||||||
|
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(554, 450);
|
||||||
|
this.Controls.Add(this.pictureBox1);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.fbt_decrypter);
|
||||||
|
this.Controls.Add(this.fbt_cryptage);
|
||||||
|
this.Controls.Add(this.fcb_typeCrypto);
|
||||||
|
this.Controls.Add(this.ftb_clef);
|
||||||
|
this.Controls.Add(this.ftb_traiter);
|
||||||
|
this.Controls.Add(this.ftb_origine);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Crypto";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private System.Windows.Forms.TextBox ftb_origine;
|
||||||
|
private System.Windows.Forms.TextBox ftb_traiter;
|
||||||
|
private System.Windows.Forms.TextBox ftb_clef;
|
||||||
|
private System.Windows.Forms.ComboBox fcb_typeCrypto;
|
||||||
|
private System.Windows.Forms.Button fbt_cryptage;
|
||||||
|
private System.Windows.Forms.Button fbt_decrypter;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
|
private Timer timer1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,136 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Media;
|
||||||
|
using System.Net;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
updateKonachanPic(this.pictureBox1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label3_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fbt_cryptage_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (fcb_typeCrypto.Text)
|
||||||
|
{
|
||||||
|
case "Dot Net":
|
||||||
|
AES_CRYPTO c = new AES_CRYPTO();
|
||||||
|
this.ftb_traiter.Text = c.Crypt(this.ftb_origine.Text, this.ftb_clef.Text);
|
||||||
|
break;
|
||||||
|
case "PERSO":
|
||||||
|
CryptoPerso d = new CryptoPerso();
|
||||||
|
this.ftb_traiter.Text = d.Crypt(this.ftb_origine.Text, this.ftb_clef.Text);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
warn w = new warn();
|
||||||
|
w.Show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
updateKonachanPic(this.pictureBox1);
|
||||||
|
|
||||||
|
}
|
||||||
|
public static void updateKonachanPic(PictureBox pictureBox)
|
||||||
|
{
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://konachan.net/post.json?tags=order%3Arandom+rating:safe&limit=1");
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
Stream receiveStream = response.GetResponseStream();
|
||||||
|
StreamReader readStream = null;
|
||||||
|
|
||||||
|
if (response.CharacterSet == null)
|
||||||
|
{
|
||||||
|
readStream = new StreamReader(receiveStream);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
|
||||||
|
}
|
||||||
|
|
||||||
|
string data = readStream.ReadToEnd();
|
||||||
|
JsonTextReader reader = new JsonTextReader(new StringReader(data));
|
||||||
|
|
||||||
|
List<KonachanPostJson> dataSet = JsonConvert.DeserializeObject<List<KonachanPostJson>>(data);
|
||||||
|
KonachanPostJson[] bla = dataSet.ToArray();
|
||||||
|
String t = bla[0].JpegUrl;
|
||||||
|
Console.WriteLine(t);
|
||||||
|
|
||||||
|
pictureBox.ImageLocation = "http:" + t;
|
||||||
|
response.Close();
|
||||||
|
readStream.Close();
|
||||||
|
|
||||||
|
}
|
||||||
|
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fcb_typeCrypto_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(fcb_typeCrypto.Text == "wubba lubba dub dub")
|
||||||
|
{
|
||||||
|
SoundPlayer player = new SoundPlayer();
|
||||||
|
player.SoundLocation = @"Rick_and_Morty_Rameses_B_Psytrance_Remix_.wav";
|
||||||
|
player.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fbt_decrypter_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (fcb_typeCrypto.Text)
|
||||||
|
{
|
||||||
|
case "Dot Net":
|
||||||
|
AES_CRYPTO c = new AES_CRYPTO();
|
||||||
|
this.ftb_traiter.Text = c.decryptage(this.ftb_origine.Text, this.ftb_clef.Text);
|
||||||
|
break;
|
||||||
|
case "PERSO":
|
||||||
|
CryptoPerso d = new CryptoPerso();
|
||||||
|
this.ftb_traiter.Text = d.decryptage(this.ftb_origine.Text, this.ftb_clef.Text);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
warn w = new warn();
|
||||||
|
w.Show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
updateKonachanPic(this.pictureBox1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void timer1_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,123 @@
|
||||||
|
<?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>
|
||||||
|
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
|
@ -0,0 +1,59 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
//https://github.com/DrCreo/WeebWrap/tree/master/src/WeebWrap
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
public class KonachanPostJson
|
||||||
|
{
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public int ID { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("source")]
|
||||||
|
public string SourceUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("file_url")]
|
||||||
|
public string FileUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("preview_url")]
|
||||||
|
public string PreviewUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("sample_url")]
|
||||||
|
public string SampleUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("jpeg_url")]
|
||||||
|
public string JpegUrl { get; set; }
|
||||||
|
|
||||||
|
public string PostUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return $"http://konachan.com/post/show/{ID}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("tags")]
|
||||||
|
public string tags { get; set; }
|
||||||
|
|
||||||
|
public List<string> Tags
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return tags.Split(' ').ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty("score")]
|
||||||
|
public int Score { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("rating")]
|
||||||
|
public string rating { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[JsonProperty("author")]
|
||||||
|
public string Author { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Point d'entrée principal de l'application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new Form1());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Les informations générales relatives à un assembly dépendent de
|
||||||
|
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
|
||||||
|
// associées à un assembly.
|
||||||
|
[assembly: AssemblyTitle("crypto")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("crypto")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
|
||||||
|
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
|
||||||
|
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
|
||||||
|
[assembly: Guid("27673584-a7c4-4d51-a966-16478d509b77")]
|
||||||
|
|
||||||
|
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
|
||||||
|
//
|
||||||
|
// Version principale
|
||||||
|
// Version secondaire
|
||||||
|
// Numéro de build
|
||||||
|
// Révision
|
||||||
|
//
|
||||||
|
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
|
||||||
|
// en utilisant '*', comme indiqué ci-dessous :
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,71 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Ce code a été généré par un outil.
|
||||||
|
// Version du runtime :4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||||
|
// le code est régénéré.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace crypto.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
|
||||||
|
/// </summary>
|
||||||
|
// Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
|
||||||
|
// à l'aide d'un outil, tel que ResGen ou Visual Studio.
|
||||||
|
// Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
|
||||||
|
// avec l'option /str ou régénérez votre projet VS.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("crypto.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remplace la propriété CurrentUICulture du thread actuel pour toutes
|
||||||
|
/// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
|
@ -0,0 +1,30 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace crypto.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
Binary file not shown.
|
@ -0,0 +1,101 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{27673584-A7C4-4D51-A966-16478D509B77}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>crypto</RootNamespace>
|
||||||
|
<AssemblyName>crypto</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<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' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="AES_CRYPTO.cs" />
|
||||||
|
<Compile Include="CryptoPerso.cs" />
|
||||||
|
<Compile Include="Form1.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Form1.Designer.cs">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="KonachanPostJson.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="warn.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="warn.Designer.cs">
|
||||||
|
<DependentUpon>warn.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Form1.resx">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="warn.resx">
|
||||||
|
<DependentUpon>warn.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Rick_and_Morty_Rameses_B_Psytrance_Remix_.wav" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
e0b408981048b0c2321568a511828a83a8518d13
|
|
@ -0,0 +1,39 @@
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.exe.config
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.exe
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.pdb
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csprojResolveAssemblyReference.cache
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.Form1.resources
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.Properties.Resources.resources
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csproj.GenerateResource.Cache
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csproj.CoreCompileInputs.cache
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.exe
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.pdb
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csprojResolveAssemblyReference.cache
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.Form1.resources
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.Properties.Resources.resources
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csproj.GenerateResource.Cache
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.exe
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.pdb
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.exe.config
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.exe
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.pdb
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\Newtonsoft.Json.dll
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\Newtonsoft.Json.xml
|
||||||
|
C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.warn.resources
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.warn.resources
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\Newtonsoft.Json.dll
|
||||||
|
G:\users\adrien\OneDriveHEL\OneDrive - Haute Ecole de la ville de Liège\2IS\POO\projet\crypto\crypto\bin\Debug\Newtonsoft.Json.xml
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.exe.config
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.exe
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\bin\Debug\crypto.pdb
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\bin\Debug\Newtonsoft.Json.dll
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\bin\Debug\Newtonsoft.Json.xml
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csprojResolveAssemblyReference.cache
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.Form1.resources
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.Properties.Resources.resources
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.warn.resources
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csproj.GenerateResource.Cache
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.csproj.CoreCompileInputs.cache
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.exe
|
||||||
|
G:\users\adrien\nextcloud\iset\2IS\2IS\POO\projet\crypto\crypto\obj\Debug\crypto.pdb
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
||||||
|
</packages>
|
|
@ -0,0 +1,78 @@
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
partial class warn
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(12, 29);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(683, 355);
|
||||||
|
this.pictureBox1.TabIndex = 0;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(267, 9);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(162, 13);
|
||||||
|
this.label1.TabIndex = 1;
|
||||||
|
this.label1.Text = "ERREUR CHOIX INCORRECTE";
|
||||||
|
this.label1.Click += new System.EventHandler(this.label1_Click);
|
||||||
|
|
||||||
|
//
|
||||||
|
// warn
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(710, 396);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.pictureBox1);
|
||||||
|
this.Name = "warn";
|
||||||
|
this.Text = "warn";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace crypto
|
||||||
|
{
|
||||||
|
public partial class warn : Form
|
||||||
|
{
|
||||||
|
public warn()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
updateKonachanPic(this.pictureBox1);
|
||||||
|
}
|
||||||
|
public warn(string t)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.label1.Text = t;
|
||||||
|
this.label1.Left = ((this.Size.Width / 2) - (this.pictureBox1.Width / 2));
|
||||||
|
updateKonachanPic(this.pictureBox1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pictureBox1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pictureBox1.Dispose();
|
||||||
|
this.Dispose();
|
||||||
|
}
|
||||||
|
public static void updateKonachanPic(PictureBox pictureBox)
|
||||||
|
{
|
||||||
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://konachan.net/post.json?tags=+order%3Arandom+rating%3Asafe+blood&limit=1");
|
||||||
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
Stream receiveStream = response.GetResponseStream();
|
||||||
|
StreamReader readStream = null;
|
||||||
|
|
||||||
|
if (response.CharacterSet == null)
|
||||||
|
{
|
||||||
|
readStream = new StreamReader(receiveStream);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
|
||||||
|
}
|
||||||
|
|
||||||
|
string data = readStream.ReadToEnd();
|
||||||
|
JsonTextReader reader = new JsonTextReader(new StringReader(data));
|
||||||
|
|
||||||
|
List<KonachanPostJson> dataSet = JsonConvert.DeserializeObject<List<KonachanPostJson>>(data);
|
||||||
|
KonachanPostJson[] bla = dataSet.ToArray();
|
||||||
|
String t = bla[0].JpegUrl;
|
||||||
|
Console.WriteLine(t);
|
||||||
|
|
||||||
|
pictureBox.ImageLocation = "http:" + t;
|
||||||
|
response.Close();
|
||||||
|
readStream.Close();
|
||||||
|
|
||||||
|
}
|
||||||
|
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,20 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2007 James Newton-King
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.10.0.3/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.10.0.3/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
8555
packages/Newtonsoft.Json.10.0.3/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml
vendored
Normal file
8555
packages/Newtonsoft.Json.10.0.3/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/Newtonsoft.Json.10.0.3/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
BIN
packages/Newtonsoft.Json.10.0.3/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
10467
packages/Newtonsoft.Json.10.0.3/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml
vendored
Normal file
10467
packages/Newtonsoft.Json.10.0.3/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,116 @@
|
||||||
|
param($installPath, $toolsPath, $package, $project)
|
||||||
|
|
||||||
|
# open json.net splash page on package install
|
||||||
|
# don't open if json.net is installed as a dependency
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
|
||||||
|
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
||||||
|
|
||||||
|
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
|
||||||
|
{
|
||||||
|
# user is installing from VS NuGet console
|
||||||
|
# get reference to the window, the console host and the input history
|
||||||
|
# show webpage if "install-package newtonsoft.json" was last input
|
||||||
|
|
||||||
|
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
||||||
|
|
||||||
|
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
|
||||||
|
[System.Reflection.BindingFlags]::NonPublic)
|
||||||
|
|
||||||
|
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
||||||
|
if ($prop -eq $null) { return }
|
||||||
|
|
||||||
|
$hostInfo = $prop.GetValue($consoleWindow)
|
||||||
|
if ($hostInfo -eq $null) { return }
|
||||||
|
|
||||||
|
$history = $hostInfo.WpfConsole.InputHistory.History
|
||||||
|
|
||||||
|
$lastCommand = $history | select -last 1
|
||||||
|
|
||||||
|
if ($lastCommand)
|
||||||
|
{
|
||||||
|
$lastCommand = $lastCommand.Trim().ToLower()
|
||||||
|
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
|
||||||
|
{
|
||||||
|
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# user is installing from VS NuGet dialog
|
||||||
|
# get reference to the window, then smart output console provider
|
||||||
|
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
|
||||||
|
|
||||||
|
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
|
||||||
|
[System.Reflection.BindingFlags]::NonPublic)
|
||||||
|
|
||||||
|
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
|
||||||
|
[System.Reflection.BindingFlags]::NonPublic)
|
||||||
|
|
||||||
|
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
|
||||||
|
|
||||||
|
$instance = $instanceField.GetValue($null)
|
||||||
|
|
||||||
|
if ($instance -eq $null) { return }
|
||||||
|
|
||||||
|
$consoleProvider = $consoleField.GetValue($instance)
|
||||||
|
if ($consoleProvider -eq $null) { return }
|
||||||
|
|
||||||
|
$console = $consoleProvider.CreateOutputConsole($false)
|
||||||
|
|
||||||
|
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
|
||||||
|
[System.Reflection.BindingFlags]::NonPublic)
|
||||||
|
if ($messagesField -eq $null) { return }
|
||||||
|
|
||||||
|
$messages = $messagesField.GetValue($console)
|
||||||
|
if ($messages -eq $null) { return }
|
||||||
|
|
||||||
|
$operations = $messages -split "=============================="
|
||||||
|
|
||||||
|
$lastOperation = $operations | select -last 1
|
||||||
|
|
||||||
|
if ($lastOperation)
|
||||||
|
{
|
||||||
|
$lastOperation = $lastOperation.ToLower()
|
||||||
|
|
||||||
|
$lines = $lastOperation -split "`r`n"
|
||||||
|
|
||||||
|
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
|
||||||
|
|
||||||
|
if ($installMatch)
|
||||||
|
{
|
||||||
|
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager")
|
||||||
|
|
||||||
|
$selection = $pmPane.TextDocument.Selection
|
||||||
|
$selection.StartOfDocument($false)
|
||||||
|
$selection.EndOfDocument($true)
|
||||||
|
|
||||||
|
if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'"))
|
||||||
|
{
|
||||||
|
# don't show on upgrade
|
||||||
|
if (!$selection.Text.Contains("Removed package"))
|
||||||
|
{
|
||||||
|
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
# stop potential errors from bubbling up
|
||||||
|
# worst case the splash page won't open
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# still yolo
|
Loading…
Reference in New Issue