Anonymní profil Lukas – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

Anonymní profil Lukas – Programujte.comAnonymní profil Lukas – Programujte.com

 

Příspěvky odeslané z IP adresy 212.79.106.–

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169687

 Skousel jsem jeste toto a nejde nestahne se to

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;
using System.IO;

namespace WindowsFormsApplication7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            Environment.ExpandEnvironmentVariables("%UserProfile%");
            WebClient client = new WebClient();
            client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
            client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
            client.DownloadFileAsync(new Uri("http://assets.minecraft.net/1_4_7/minecraft.jar"), @"C:\Users\%UserProfile%\AppData\Roaming\.minecraft\bin\minecraft.jar");
        }
        void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            MessageBox.Show("Hotovo nahrano");
            progressBar1.Value = 0; 
        }
        void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
        {
            string sFormatted = string.Format("{0} of {1}", e.BytesReceived, e.TotalBytesToReceive);

            Invoke(new MethodInvoker(delegate
            {
                progressBar1.Value = e.ProgressPercentage;
            }));
        }
    }
}
Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169685

#16 zlz
Ja sem to skousel ale nevim jak to tam  mam myt

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169684

Ja jsem si napsal vse jen ted nevim kam to mam dat jak to tam vlozit a kam.

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169683

#16 zlz
a to mam kam dat ten kod do scriptu kam

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169680

Tak jsem skusil jeste neco a nevim v cem je chyba stahne se to ale nepresune do appdat viz kod

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;
using System.IO;

namespace WindowsFormsApplication7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(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://assets.minecraft.net/1_4_7/minecraft.jar"), @"C:\PFiles\minecraft.jar");
        }
        void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            MessageBox.Show("Hotovo nahrano");
            progressBar1.Value = 0;
            string sourceFile = @"C:\PFiles\minecraft.jar";
            string destinationFile = @"%USERPROFILE%\AppData\Roaming\.minecraft\bin\minecraft.jar";

            // To move a file or folder to a new location:
            System.IO.File.Move(sourceFile, destinationFile);

            // To move an entire directory. To programmatically modify or combine
            // path strings, use the System.IO.Path class.
            System.IO.Directory.Move(@"C:\PFiles\", @"%appdata%\.minecraft\bin\");
        }
        void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
        {
            string sFormatted = string.Format("{0} of {1}", e.BytesReceived, e.TotalBytesToReceive);

            Invoke(new MethodInvoker(delegate
            {
                progressBar1.Value = e.ProgressPercentage;
            }));
        }
    }
}
Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169679

Hale neco mně napadlo co kdybych ja ty soubory stahnul na C:/ a pak je teprve premistil

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169677

Tak jsem hledal i po po netu a nic nemuzu najit tak nevim

Lukas
C / C++ › Jak ukladat do appdata/roami…
2. 1. 2013   #169676
Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169675

Takto je celý kod tak nevim co kde je chyba proc se to nechce nahrat

private void button1_Click(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://assets.minecraft.net/1_4_7/minecraft.jar"), @"%USERPROFILE%\AppData\Roaming\.minecraft\bin\minecraft.jar");
        }
        void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
        {
            string sFormatted = string.Format("{0} of {1}", e.BytesReceived, e.TotalBytesToReceive);

            Invoke(new MethodInvoker(delegate
            {
                progressBar1.Value = e.ProgressPercentage;
            }));
        }
        void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            MessageBox.Show("Hotovo nahrano");
            progressBar1.Value = 0;
        }
    }
Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169674

Tak jsem skusil toto  a nic

WebClient client = new WebClient();
            client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
            client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
            client.DownloadFileAsync(new Uri("http://assets.minecraft.net/1_4_7/minecraft.jar"), @"%USERPROFILE%\AppData\Roaming\.minecraft\bin\minecraft.jar");
Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169673

#9 Miner
ale kdyz chci neco ukaldat do roaming

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169671

#7 Miner
skusim %USERPROFILE%\AppData\zde mas spis byt roaming ne

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169669

#5 Miner
Ja to chci udelat pro ty neskušene taky na instalator modu, skoušel jsme i toto a ni  

(@"%appdata%/.minecraft/bin")
Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169667

#3 Lukas
Ja to hci udelat bez nastavovani klidne a udela se to v jakem koliv pc

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169666

#2 Miner
Jasně ale když to nekdo stahne tak jak on si tam zase nastavi svoje jemno

Lukas
.NET › Jak ukladat do appdata/roami…
2. 1. 2013   #169664

Dobry den chtel bych si udelat Uppdator ktery by si lidi stahli a nahralo jim to napr.snapshot minecraftu do appdat ale nevim jak to mam udelat

Kdyz stahnul soubor z netu viz kod

ebClient client2 = new WebClient();
            client2.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client2_DownloadProgressChanged);
            client2.DownloadFileCompleted += new AsyncCompletedEventHandler(client2_DownloadFileCompleted);
            client2.DownloadFileAsync(new Uri("Zde dam odkud se to bude stahovat"), @"ale co zde abych ukaldal do appdata");

Lukas
C / C++ › Jak ukladat do appdata/roami…
2. 1. 2013   #169663

#2 vitamin
aha

Lukas
C / C++ › Jak ukladat do appdata/roami…
2. 1. 2013   #169661

Dobry den chtel bych si udelat Uppdator ktery by si lidi stahli a nahralo jim to napr.snapshot minecraftu do appdat ale nevim jak to mam udelat

Kdyz stahnul soubor z netu viz kod

ebClient client2 = new WebClient();
            client2.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client2_DownloadProgressChanged);
            client2.DownloadFileCompleted += new AsyncCompletedEventHandler(client2_DownloadFileCompleted);
            client2.DownloadFileAsync(new Uri("Zde dam odkud se to bude stahovat"), @"ale co zde abych ukaldal do appdata");
Lukas
Visual Basic › V labelu kolik se stahlo
2. 1. 2013   #169656

Vyřešno

Lukas
Visual Basic › V labelu kolik se stahlo
2. 1. 2013   #169655

void WebClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
    string sFormatted = string.Format("{0} of {1}", e.BytesReceived, e.TotalBytesToReceive);

    Invoke(new MethodInvoker(delegate
    {
        myProgressBar.Value = e.ProgressPercentage; //MyprogressBar nazev progressbaru
        myLabel.Text = sFormatted;    //mylabel nazev labelu
    }));
}

Lukas
Visual Basic › V labelu kolik se stahlo
2. 1. 2013   #169654

Dobrý den, mám dotaz jestly jse dá nějak udělat to aby se mi v labelu zobrazovalo kolik už se stahlo dat jako v Bytes

a kolik zbívá.

 

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý