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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cleancode-webget-tool

#rachid
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rhwy/cleancode-webget-tool?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


Expand Down
20 changes: 20 additions & 0 deletions Students/Rachid OUADI/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", "{29FC1442-DEA5-4EF1-95BC-C1EA44B9980B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{29FC1442-DEA5-4EF1-95BC-C1EA44B9980B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29FC1442-DEA5-4EF1-95BC-C1EA44B9980B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29FC1442-DEA5-4EF1-95BC-C1EA44B9980B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29FC1442-DEA5-4EF1-95BC-C1EA44B9980B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Students/Rachid OUADI/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>
113 changes: 113 additions & 0 deletions Students/Rachid OUADI/nget -v1/nget/nget/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Timers;

namespace nget
{
class Program
{
static void Main(string[] args)
{
bool bonArg = false;
try
{
if (args.Length == 3)
{
if (args[0] == "get" && args.Length == 3)
{

using (var client = new WebClient())
{
string result = client.DownloadString(args[2]);
Console.WriteLine(result);
bonArg = true;

}
}
}
else if (args.Length == 5)
{
if (args[0] == "get" && args[3] == "-save")
{
using (var client = new WebClient())
{
string result = client.DownloadString(args[2]);
File.WriteAllText(args[4], result);
bonArg = true;

}
}


if (args[0] == "get" && args[3] == "-times")
{


for (int i = 0; i < Convert.ToInt32(args[4]); i++)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
using (var client = new WebClient())
{
string result = client.DownloadString(args[2]);
}

stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;

Console.WriteLine("Chargement numero " + (i + 1) + " : " + ts.Milliseconds + "ms");
bonArg = true;
}
}
}
else if (args.Length == 6)
{
Stopwatch stopWatch = new Stopwatch();
ArrayList tps = new ArrayList();

for (int i = 0; i < Convert.ToInt32(args[4]); i++)
{
stopWatch.Start();
using (var client = new WebClient())
{
string result = client.DownloadString(args[2]);
}

stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
tps.Add(Convert.ToInt32(ts.Milliseconds));
}
double dbResult = 0.0;
for (int i = 0; i < tps.Count; i++)
{
dbResult += Convert.ToDouble(tps[i]);
}
dbResult = dbResult / Convert.ToInt32(args[4]);
Console.WriteLine("time : " + dbResult + "ms");
bonArg = true;
}
if (bonArg == false)
{
Console.WriteLine("Bad arg");
Console.ReadLine();
Environment.Exit(0);
}
}

catch (Exception e)
{
Console.WriteLine(e.ToString());
}

Console.ReadLine();

}
}
}
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("3146940c-7709-4a84-90c9-794c48787df0")]

// 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")]
66 changes: 66 additions & 0 deletions Students/Rachid OUADI/nget -v1/nget/nget/nget.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?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>{29FC1442-DEA5-4EF1-95BC-C1EA44B9980B}</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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- 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>
20 changes: 20 additions & 0 deletions Students/Rachid OUADI/nget -v2/nget-v2/nget-v2.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-v2", "nget-v2\nget-v2.csproj", "{005DA57B-91D7-453B-9B91-CE6DE6348950}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{005DA57B-91D7-453B-9B91-CE6DE6348950}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{005DA57B-91D7-453B-9B91-CE6DE6348950}.Debug|Any CPU.Build.0 = Debug|Any CPU
{005DA57B-91D7-453B-9B91-CE6DE6348950}.Release|Any CPU.ActiveCfg = Release|Any CPU
{005DA57B-91D7-453B-9B91-CE6DE6348950}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Students/Rachid OUADI/nget -v2/nget-v2/nget-v2/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>
Loading