All pastes #803101 Raw Edit

Miscellany

public text v1 · immutable
#803101 ·published 2007-11-30 22:02 UTC
rendered paste body
 public String CreateCode()
        {
            Random rnd = new Random();
            int SiteMovieLen = this.OnSiteMovie.SelectedItem.ToString().Length;
            int SiteCategoryLen = this.OnSiteCategory.SelectedItem.ToString().Length;
            int SiteMovieRandom = rnd.Next(0,SiteMovieLen);
            int SiteCategoryRandom = rnd.Next(0,SiteCategoryLen);
            string code = this.OnSiteMovie.SelectedItem.ToString().Substring(0,SiteMovieRandom);
            code += this.OnSiteDay.SelectedIndex.ToString();
            code += this.OnSiteNr.SelectedIndex.ToString();
            code += this.OnSiteTime.SelectedIndex.ToString();
            code += this.OnSiteCategory.SelectedItem.ToString().Substring(0,SiteCategoryRandom);
            return code;
        }