Topic: dll  (Read 1604 times)

0 Members and 1 Guest are viewing this topic.

Offline toasty0

  • Application.Quit();
  • Captain
  • *
  • Posts: 8045
  • Gender: Male
dll
« on: May 21, 2005, 12:08:10 am »
I never realized creating a dynamic-linked-library could be this easy or this much fun.


using System;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;

namespace StepByStep7_1
{
   /// <summary>
   /// Summary description for RandomNumber.
   /// </summary>
   public class RandomNumber : System.ComponentModel.Component
   {
      /// <summary>
      /// Required designer variable.
      /// </summary>
      private System.ComponentModel.Container components = null;

      public RandomNumber(System.ComponentModel.IContainer container)
      {
         ///
         /// Required for Windows.Forms Class Composition Designer support
         ///
         container.Add(this);
         InitializeComponent();

         //
         // TODO: Add any constructor code after InitializeComponent call
         //
      }

      public RandomNumber()
      {
         ///
         /// Required for Windows.Forms Class Composition Designer support
         ///
         InitializeComponent();
         minValue=100;
         maxValue=1000;

         //
         // TODO: Add any constructor code after InitializeComponent call
         //
      }

      /// <summary>
      /// Clean up any resources being used.
      /// </summary>
      protected override void Dispose( bool disposing )
      {
         if( disposing )
         {
            if(components != null)
            {
               components.Dispose();
            }
         }
         base.Dispose( disposing );
         minValue=0;
         maxValue=0;
      }


      #region Component Designer generated code
      /// <summary>
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// </summary>
      private void InitializeComponent()
      {
         components = new System.ComponentModel.Container();
      }
      #endregion

      /// <summary>
      /// Store the minimum value for random number
      /// </summary>
      public int minValue;
      /// <summary>
      /// Store the max value for random number
      /// </summary>
      public int maxValue;

      /// <summary>
      /// Gets or Sets the min value for the random number
      /// </summary>
      public int MinValue
      {
         get
         {
            return minValue;
         }
         set
         {
            minValue=value;
         }
      }

      /// <summary>
      /// Gets or Sets the max value for the random number
      /// </summary>
      public int MaxValue
      {
         get
         {
            return maxValue;
         }
         set
         {
            maxValue=value;
         }
      }

      public int GenerateRandomNumber()
      {
         Random r=new Random();
         return r.Next(MinValue, MaxValue);
      
      }
   }
}


Jerry
MCTS: SQL Server 2005 | MCP: Windows Server 2003 | MCTS: Microsoft Certified Technology Specialist | MCT: Microsoft Certified Trainer | MOS: Microsoft Office Specialist 2003 | VSP: VMware Sales Professional | MCTS: Vista

Offline Nemesis

  • Captain Kayn
  • Global Moderator
  • Commodore
  • *
  • Posts: 13067
Re: dll
« Reply #1 on: May 21, 2005, 12:13:33 am »
I never realized creating a dynamic-linked-library could be this easy or this much fun.

Jerry

You need to get out more.  :screwloose:
Do unto others as Frey has done unto you.
Seti Team    Free Software
I believe truth and principle do matter. If you have to sacrifice them to get the results you want, then the results aren't worth it.
 FoaS_XC : "Take great pains to distinguish a criticism vs. an attack. A person reading a post should never be able to confuse the two."

Offline toasty0

  • Application.Quit();
  • Captain
  • *
  • Posts: 8045
  • Gender: Male
Re: dll
« Reply #2 on: May 21, 2005, 12:40:27 am »
I never realized creating a dynamic-linked-library could be this easy or this much fun.

Jerry

You need to get out more.  :screwloose:

That's not what my doc told me...but I'm better now.
MCTS: SQL Server 2005 | MCP: Windows Server 2003 | MCTS: Microsoft Certified Technology Specialist | MCT: Microsoft Certified Trainer | MOS: Microsoft Office Specialist 2003 | VSP: VMware Sales Professional | MCTS: Vista