Användarprofil

Uppgifter
Användarnamn
Email
Besök -
Hemsida Ingen
Plats (stad)
Senaste besök 01:00 - 1:a Januari 1970
Poster i forumet
Varningar
Grupp
Medlem sedan 01:00 - 1:a Januari 1970
Artiklar och filer
Den här användaren har inga artiklar eller filer

Avatar


Presentation av

Den här användaren har inte skapat någon personlig presentation.

Senaste inläggen i forumet

string object inuti For Loop C#
Såhär laddar jag ner filer med min youtube downloader:


private void Download()
{
try
{
Uri objUri = new Uri(YoutubeDownload.GetYoutubeLink(this.txtYoutubeLink.Text));

//Get file content
WebRequest wrRequest = WebRequest.Create(objUri);
WebResponse wrResponse = wrRequest.GetResponse();
Stream objStream = wrResponse.GetResponseStream();

Int64 fileSize = wrResponse.ContentLength;

if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube"))
{
Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube");
}

FileStream fsStream = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\" + this.lblOrgTitle.Text, FileMode.Create, FileAccess.Write);
byte[] bteRead = new byte[256];

int iCount = objStream.Read(bteRead, 0, bteRead.Length);

while (iCount > 0)
{
fsStream.Write(bteRead, 0, iCount);
iCount = objStream.Read(bteRead, 0, bteRead.Length);

this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { fsStream.Length, fileSize });
}

fsStream.Close();
objStream.Close();
wrResponse.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if (this.cboMp3.Checked)
{
YoutubeDownload.EncodeFormatFromMp4ToMp3(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\" + this.lblOrgTitle.Text,
Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\" + this.lblSaveAs.Text, false);
}
else
{
File.Copy(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\" + this.lblOrgTitle.Text,
Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\" + this.lblSaveAs.Text, true);
File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\video4.mp4");
}
if (this.tboLog.InvokeRequired)
{
string strUpdateText = "[*] File completly downloaded, it can be accessed at " + Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\KekTube\";
// It's on a different thread, so use Invoke.
SetTextCallback d = new SetTextCallback(updateLog);
this.Invoke
(d, new object[] { strUpdateText });
}

}
}


Postad 18:14 - 9:e Februari 2010
string object inuti For Loop C#
for (int i = 255200; i < 256200; i++)
{
string sFile = "http://www.somedomain.com/../../XMLmatchID=" + i.ToString();
}


Postad 21:27 - 22:a December 2009
eject dvd rom (E:) i C#
I know what many of you are thinking now: "I have multiple CD / DVD drives and only one of them opens. How can I choose which one?".
The commands we sent above, only open / close the drive that's marked as the default drive for playing audio CDs. To open the other drives, we need to specify the letter of the drive that we wish to open. Let's say you have two DVD drives - H: and I: - like I do. Replace the code we wrote before in the button event handlers, with the following:


// Open Drive H:
mciSendString("open H: type CDAudio alias driveH", null, 0, IntPtr.Zero);
mciSendString("set driveH door open", null, 0, IntPtr.Zero);
// Open Drive I:
mciSendString("open I: type CDAudio alias driveI", null, 0, IntPtr.Zero);
mciSendString("set driveI door open", null, 0, IntPtr.Zero);


We first create an alias name for the H: drive named driveH, as a CDAudio type of drive, then in the second command, we open it by specifing the alias instead of CDAudio. The same thing is done for the I: drive.
The command for closing both drives is now obvious:

// Close Drive H:
mciSendString("open H: type CDAudio alias driveH", null, 0, IntPtr.Zero);
mciSendString("set driveH door closed", null, 0, IntPtr.Zero);
// Close Drive I:
mciSendString("open I: type CDAudio alias driveI", null, 0, IntPtr.Zero);
mciSendString("set driveI door closed", null, 0, IntPtr.Zero);


Postad 22:53 - 16:e December 2009
hjääälp :S panik.. python
Använd en struktur eller klass, och returnera klassen/strukturen.

Postad 02:13 - 16:e December 2009
Miniräknare hjälp!
Aldrig bra vana att göra oändliga while-loopar.

while(input != '2')
{
//visa räknaren

//i slutet, hämta input och kolla i while loopen va det är igen.
}

//avsluta programmet
return 0;

Postad 19:27 - 14:e December 2009

Skicka meddelande
Läs s blog