Résolu Help je trouve pas | C:\Users\?????\bureau

Statut
N'est pas ouverte pour d'autres réponses.

Le-Melvin

<3 Destiny <3
Premium
Inscription
29 Août 2011
Messages
1 142
Réactions
324
Points
20 336
RGCoins
25
Salut ,

Je vien de faire un petit tool me arrive a un niveau ou je suis bloque Je vous fait voir

Fjb4DGH.png




@"C:\Users\ICI \Desktop\tool.zip" ( ICI, comment mettre le nom de la personne ( Tool partage = USER ))
@"C:\Users\Melvin\Desktop\tool.zip" Pour moi c'est


Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;

namespace toolprive
{
  public partial class Dow : Form
  {
  public Dow()
  {
  InitializeComponent();
  }

  private void Dow_Load(object sender, EventArgs e)
  {
  WebClient client = new WebClient();
  client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
  client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
  client.DownloadFileAsync(new Uri("http://frenchmodz.fr/%20fm62.exe"), @"C:\Users\?????\Desktop\tool.zip");


  }
  void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
  {
  MessageBox.Show("lol");
  }
  void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
  {
  progressBar1.Maximum = (int)e.TotalBytesToReceive / 100;
  progressBar1.Value = (int)e.TotalBytesToReceive / 100;
  }
  }
}

merci a vous
 
Salut,

Utilise Environment.UserName.


Code:
client.DownloadFileAsync(new Uri("http://frenchmodz.fr/%20fm62.exe"), @"C:\Users\" + Envuronment.UserName + "\Desktop\tool.zip");
 
Salut,

Tu fait comme ça et c'est réglé :
Code:
string Path = @"C:\Users\" + Environment.UserName + @"\Desktop\Tonfichier.zip";

Bonne après-midi,
DEVR0 GTP
Salut deja merci
toujours un problème !
Code:
  client.DownloadFileAsync(new Uri("lien"), string Path = @"C:\Users\" + Environment.UserName + @"\Desktop\Tonfichier.zip";
VhftNn5.png
 
Résolu
WebClient client = new WebClient();
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
client.DownloadFileAsync(new Uri(" fm62.exe"), @"C:\Users\" + Environment.UserName + @"\Desktop\Telechargement.zip");
 
Salut deja merci
toujours un problème !
Code:
  client.DownloadFileAsync(new Uri("lien"), string Path = @"C:\Users\" + Environment.UserName + @"\Desktop\Tonfichier.zip";
VhftNn5.png
Retire le string Path c'est juste une variable locale au cas ou tu utiliserais plusieurs fois le chemin, met uniquement le chemin soit tu met string Path ailleurs et après t'as virgule tu met Path soit tu met uniquement
@"C:\Users\" + Environment.UserName + @"\Desktop\Tonfichier.zip"
 
Dernière édition par un modérateur:
Cette réponse a aidé l'auteur de cette discussion !
Statut
N'est pas ouverte pour d'autres réponses.
Retour
Haut