vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: C# Anyone??????? - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
C# Anyone??????? (8th Oct 09 at 5:32am UTC)
I'm just wondering, does anyone here know how to code in C#? I'm having problems with a code that i'm writing yet it gives no errors at all, and I'm looking for someone who can look it over and can possibly help me find out what I have done wrong.

Code:
 
  1. using System;
  2. using System.ComponentModel;
  3. using System.Windows.Forms;
  4. using System.Diagnostics;
  5. using System.IO;
  6. using ICSharpCode.SharpZipLib.Zip;
  7. using System.Net;
  8. using System.Text;
  9.  
  10. namespace Divine_Shadows
  11. {
  12.     public partial class DSL : Form
  13.     {
  14.         public DSL()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.         public WebClient update = new WebClient();
  19.         public FastZip zip = new FastZip();
  20.         private void DSL_Load(object sender, EventArgs e)
  21.         {
  22.             decimal Version = 0.0m;
  23.             {
  24.                 HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.divineshadowsonline.com/game/version.txt");
  25.                 HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  26.                 StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(1252));
  27.                 decimal Online = 0.0m;
  28.                 Online = Convert.ToDecimal(sr.ReadToEnd());
  29.  
  30.                 if (Version >= Online)
  31.                 {
  32.                     File_Progress_Title.Text = "100%";
  33.                     Total_Progress_Title.Text = "100%";
  34.                     VersionOld.Visible = false;
  35.                     VersionNew.Visible = true;
  36.                 }
  37.                 else
  38.                 {
  39.                     VersionNew.Visible = false;
  40.                     VersionOld.Visible = true;
  41.                     update.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressCallback);
  42.                     update.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadCompleted);
  43.                     Update_Status.Text = "Updating...";
  44.                     while (update.IsBusy)
  45.                     {
  46.                         Application.DoEvents();
  47.                     }
  48.                     update.DownloadFileAsync(new Uri("http://www.divineshadowsonline.com/game/updates/patch.zip"), @"C:\patch.zip");
  49.                 }
  50.             }
  51.         }
  52.         public void DownloadProgressCallback(object sender, DownloadProgressChangedEventArgs e)
  53.         {
  54.             File_Progress_Display.Value = e.ProgressPercentage;
  55.             File_Progress_Title.Text = Convert.ToString(e.ProgressPercentage) + "%";
  56.         }
  57.  
  58.         public void DownloadCompleted(Object sender, AsyncCompletedEventArgs e)
  59.         {
  60.             zip.ExtractZip(@"C:\patch.zip", Application.StartupPath.ToString(), @"C:\Program Files\Divine Shadows\");
  61.         }
  62.         private void Close_Click(object sender, EventArgs e)
  63.         {
  64.             Close();
  65.         }
  66.  
  67.         private void Register_Click(object sender, EventArgs e)
  68.         {
  69.             Process.Start("http://www.divineshadowsonline.com/register.php");
  70.         }
  71.  
  72.         private void Play_Click(object sender, EventArgs e)
  73.         {
  74.             Process.Start("Game.exe");
  75.         }
  76.  
  77.         private void Minimize_Click(object sender, EventArgs e)
  78.         {
  79.             this.WindowState = FormWindowState.Minimized;
  80.         }
  81.  
  82.         private void Help_Click(object sender, EventArgs e)
  83.         {
  84.             Process.Start("http://www.divineshadowsonline.com/faq.php");
  85.         }
  86.  
  87.         private void Forum_Click(object sender, EventArgs e)
  88.         {
  89.             Process.Start("http://www.forum.divineshadowsonline.com");
  90.         }
  91.  
  92.         private void WSite_Click(object sender, EventArgs e)
  93.         {
  94.             Process.Start("http://www.divineshadowsonline.com");
  95.         }
  96.  
  97.         private void pictureBox4_Click(object sender, EventArgs e)
  98.         {
  99.             Process.Start("http://www.shiningashes.net");
  100.         }
  101.     }
  102. }
 



And for those that would like to see what i'm working on here is a picture:

Image
Jason
Moderator
*****

[Avatar]
www.random-image.net

Posts: 223
Status: Offline
Gender: Male
Location: University of Waterloo, Canada
Age: 36
Joined:  

Additional Groups:
Spell Checker
**


Reputation: 22%  


pmwww
Re: C# Anyone??????? (11th Oct 09 at 4:12am UTC)
Posted By dog199200 on 8th Oct 09 at 5:32am
 
I'm just wondering, does anyone here know how to code in C#? I'm having problems with a code that i'm writing yet it gives no errors at all, and I'm looking for someone who can look it over and can possibly help me find out what I have done wrong.

Code:
 
  1. using System;
  2. using System.ComponentModel;
  3. using System.Windows.Forms;
  4. using System.Diagnostics;
  5. using System.IO;
  6. using ICSharpCode.SharpZipLib.Zip;
  7. using System.Net;
  8. using System.Text;
  9.  
  10. namespace Divine_Shadows
  11. {
  12.     public partial class DSL : Form
  13.     {
  14.         public DSL()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.         public WebClient update = new WebClient();
  19.         public FastZip zip = new FastZip();
  20.         private void DSL_Load(object sender, EventArgs e)
  21.         {
  22.             decimal Version = 0.0m;
  23.             {
  24.                 HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.divineshadowsonline.com/game/version.txt");
  25.                 HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  26.                 StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(1252));
  27.                 decimal Online = 0.0m;
  28.                 Online = Convert.ToDecimal(sr.ReadToEnd());
  29.  
  30.                 if (Version >= Online)
  31.                 {
  32.                     File_Progress_Title.Text = "100%";
  33.                     Total_Progress_Title.Text = "100%";
  34.                     VersionOld.Visible = false;
  35.                     VersionNew.Visible = true;
  36.                 }
  37.                 else
  38.                 {
  39.                     VersionNew.Visible = false;
  40.                     VersionOld.Visible = true;
  41.                     update.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressCallback);
  42.                     update.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadCompleted);
  43.                     Update_Status.Text = "Updating...";
  44.                     while (update.IsBusy)
  45.                     {
  46.                         Application.DoEvents();
  47.                     }
  48.                     update.DownloadFileAsync(new Uri("http://www.divineshadowsonline.com/game/updates/patch.zip"), @"C:\patch.zip");
  49.                 }
  50.             }
  51.         }
  52.         public void DownloadProgressCallback(object sender, DownloadProgressChangedEventArgs e)
  53.         {
  54.             File_Progress_Display.Value = e.ProgressPercentage;
  55.             File_Progress_Title.Text = Convert.ToString(e.ProgressPercentage) + "%";
  56.         }
  57.  
  58.         public void DownloadCompleted(Object sender, AsyncCompletedEventArgs e)
  59.         {
  60.             zip.ExtractZip(@"C:\patch.zip", Application.StartupPath.ToString(), @"C:\Program Files\Divine Shadows\");
  61.         }
  62.         private void Close_Click(object sender, EventArgs e)
  63.         {
  64.             Close();
  65.         }
  66.  
  67.         private void Register_Click(object sender, EventArgs e)
  68.         {
  69.             Process.Start("http://www.divineshadowsonline.com/register.php");
  70.         }
  71.  
  72.         private void Play_Click(object sender, EventArgs e)
  73.         {
  74.             Process.Start("Game.exe");
  75.         }
  76.  
  77.         private void Minimize_Click(object sender, EventArgs e)
  78.         {
  79.             this.WindowState = FormWindowState.Minimized;
  80.         }
  81.  
  82.         private void Help_Click(object sender, EventArgs e)
  83.         {
  84.             Process.Start("http://www.divineshadowsonline.com/faq.php");
  85.         }
  86.  
  87.         private void Forum_Click(object sender, EventArgs e)
  88.         {
  89.             Process.Start("http://www.forum.divineshadowsonline.com");
  90.         }
  91.  
  92.         private void WSite_Click(object sender, EventArgs e)
  93.         {
  94.             Process.Start("http://www.divineshadowsonline.com");
  95.         }
  96.  
  97.         private void pictureBox4_Click(object sender, EventArgs e)
  98.         {
  99.             Process.Start("http://www.shiningashes.net");
  100.         }
  101.     }
  102. }
 



And for those that would like to see what i'm working on here is a picture:

Image


Hmm... I know some things about C#... =P

So what exactly is the problem then?

Image Randomizers - official vForums partner
Image
^ Live stats {Grin} ^
dog199200
Guest
Re: C# Anyone??????? (11th Oct 09 at 4:28am UTC)
well i figured out the problem, the launching code for the function didn't get added to the designer file. one small question, do you know how to track the bit rate of a file?
Jason
Moderator
*****

[Avatar]
www.random-image.net

Posts: 223
Status: Offline
Gender: Male
Location: University of Waterloo, Canada
Age: 36
Joined:  

Additional Groups:
Spell Checker
**


Reputation: 22%  


pmwww
Re: C# Anyone??????? (12th Oct 09 at 7:50pm UTC)
Posted By dog199200 on 11th Oct 09 at 4:28am
 
well i figured out the problem, the launching code for the function didn't get added to the designer file. one small question, do you know how to track the bit rate of a file?


Not too sure about that one. Maybe someone else here does...

Image Randomizers - official vForums partner
Image
^ Live stats {Grin} ^
dog199200
Guest
Re: C# Anyone??????? (13th Oct 09 at 1:00am UTC)
yea sadly everyone I asked is clueless lol
 Printable View

All times are GMT+0 :: The current time is 11:55am
Page generated in 0.7071 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums