Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@


English readme not available at this time, it's only available in [french](readme.fr.md)

FLAMANT Gr�gory-William
20 changes: 20 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nget", "nget\nget.csproj", "{2BE05532-1D3A-4338-AEAC-A3BDA4684F75}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2BE05532-1D3A-4338-AEAC-A3BDA4684F75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BE05532-1D3A-4338-AEAC-A3BDA4684F75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BE05532-1D3A-4338-AEAC-A3BDA4684F75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BE05532-1D3A-4338-AEAC-A3BDA4684F75}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
14 changes: 14 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget/Menu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace nget
{
//Classe qui affiche les options à l'utilisateur mode console
class Menu
{

}
}
86 changes: 86 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget/MenuTraitement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace nget
{
//Traitement du choix/arguments de l'utilisateur
class MenuTraitement
{
//Arguments de l'utilisateur
string argument;
string[] arguments;

public MenuTraitement(string[] args)
{
this.argument = string.Join(" ", args);
this.arguments = args;
matchRegle();
}

private void matchRegle()
{
Regles regles = new Regles();
MatchCollection matche;
int ind = 0;

foreach (Regex regle in regles.LstRegles)
{
matche = regle.Matches(this.argument);
Console.WriteLine("\nTest de la règle : " + ind);
if (matche.Count > 0)
{
doTraitement(ind);
break;
}
Console.WriteLine("Règle ne match pas.\n" + ind);
ind++;
}
}

private void doTraitement(int traitement)
{
try
{
switch (traitement)
{
case 0:
try
{
using (System.Net.WebClient client = new WebClient())
{
char[] separator = { '\"' };
this.arguments[2] = this.arguments[2].Split(separator).ToString();
string fileContent = client.DownloadString(this.arguments[2]);
Console.WriteLine(fileContent);
}
}
catch (Exception)
{
Console.WriteLine("Impossible d'accéder au site...");
}

break;
case 1:

break;
case 2:
break;
case 3:
break;
default:
break;
}
}
catch (Exception)
{
Console.WriteLine("Une erreur est survenue...");
}

}
}
}
18 changes: 18 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace nget
{
//Point d'entrée du programme
class Program
{
static void Main(string[] args)
{
new MenuTraitement(args);
Console.Read();
}
}
}
Original file line number Diff line number Diff line change
@@ -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("nget")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("nget")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[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("e854eaf4-3f8e-496b-8158-79fb17df67fb")]

// 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")]
27 changes: 27 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget/Regles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace nget
{
class Regles
{
//Impossible d'utiliser var ça ne fonctionne pas...
List<Regex> lstRegles = new List<Regex>();

public Regles()
{
//Règle une
string pattern = @"get\\s-url\\s""[A-z|0-9|\\:|\\/]*""";
lstRegles.Add(new Regex(pattern, RegexOptions.IgnoreCase));
}

public List<Regex> LstRegles
{
get { return lstRegles; }
}
}
}
61 changes: 61 additions & 0 deletions Students/flamant-gregory/nget-v1/nget/nget/nget.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{2BE05532-1D3A-4338-AEAC-A3BDA4684F75}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>nget</RootNamespace>
<AssemblyName>nget</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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="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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Menu.cs" />
<Compile Include="MenuTraitement.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Regles.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>