using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace RedSITI_Compras
{
class Program
{
static void ExecuteConnect(string _Departamento)
{
string[] _Red = new string[4];
if (_Departamento.ToUpper().Equals("COMPRAS"))
{
_Red[0] = @"net use P: \\10.2.2.1\Personal /USER:sitiver sitiver /PERSISTENT:YES";
_Red[1] = @"net use S: \\10.2.2.1\Software /USER:sitiver sitiver /PERSISTENT:YES";
_Red[2] = @"net use T: \\10.2.2.2\Publico /USER:Compras TeamC2015 /PERSISTENT:YES";
_Red[3] = @"net use X: \\10.2.2.2\Compras /USER:Compras TeamC2015 /PERSISTENT:YES";
for (int i = 0; i < 4; i++)
{
System.Diagnostics.ProcessStartInfo procStarInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + _Red[i]);
procStarInfo.RedirectStandardOutput = true;
procStarInfo.UseShellExecute = false;
procStarInfo.CreateNoWindow = false;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStarInfo;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
Console.Write(result);
}
}
}
static void Main(string[] args)
{
string Depto = "COMPRAS";
string command = string.Empty;
Console.WriteLine("Conectado a las unidades de Red de SI-TI...");
Console.WriteLine("Perfil: " + Depto);
ExecuteConnect("COMPRAS");
Console.Write("Pulse una tecla para salir");
Console.ReadKey();
}
}
}