.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to use RSA or des,md5 TO make a random number generator?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :.NET Framework

how to use RSA or des,md5 TO make a random number generator?

View Complete Post

More Related Resource Links

Getting a random number generator to be specific.


Random rand = new Random((int)DateTime.Now.Ticks);
        int numIterations = 0;
        numIterations = rand.Next(1, 50);
        Response.Write(' ');
        numIterations = rand.Next(1, 50);
        Response.Write(' ');
        numIterations = rand.Next(1, 100);
        Response.Write(' ');
        numIterations = rand.Next(50, 100);
        Response.Write(' ');
        numIterations = rand.Next(50,100);
        Response.Write(' ');

how to use random generate number with linq

how to use random generate number with linqthanks in Advance:)

get random number less than x

hi how can i get a random number less than x. Best Regards. morteza

how to generate a unique random number on a form submission?


I want to generate a unique random number everytime a user submits a form. As the form is submited the data of the form should be placed in a database and a unique random number should be generated so that the user can later use this unique random number to reterieve his details from the database that refer to his unique random id. The unique random number should be atleast 9 digits long. Please help me on this.

What would make array.length return an incorrect number?


[sub-titled: array.length is working correctly, but Nick has almost certainly done something stupid.] 

This is probably obvious, but has got me mystified.  I have an array which is being created like this:

var TempPoints = $get('<%=PointList.ClientID%>').value;
PointsList = eval(TempPoints);

The field coming in from the server is formatted like this:

[[1,2], [3,4], [5,6], ......... [99, 100]]

So, after the eval has done its work, PointsList is an array of objects, each of which is an array containing two numbers.  If I then do a PointsList.length, I would expect to see the number of elements in the array.  I then of course need to remember that the array is zero based and that the last element is (PointsList.length - 1).  Well, so I would have thought!

In fact, the length seems to be reporting one more than it should, so the last element is actually (PointsList.length - 2).

That is borne out by what I can see in the Visual Studio debugger:

Visual Studio Screenshot

As you can see there, the array has elements 0 through 138 - but the length is reported as 140.

What am I missing?



How to make number of columns of Gridview depends on a textbox value?


I have a Gridview with 12 columns, Jan, Feb...Dec.
I have a textbox value that could be 1, 2,...12

I want if textbox value is 7, then column Aug-Dec in Gridview is editable when in update mode and the column in Jan-Jul is not updatable (eg make it label instead of textbox).

How can I do this ?


VB - Random Number for Multiple Labels



Not sure if I'm approaching this correctly but this is what I've got and what I'm trying to do

I have a table with 10 Labels in it (Labels Id A1 thru A10)

I'm trying to have each label assigned a random number using 0-9

Need to have each labels number value different from the other

Code Below:


A1.Text = Int(Rnd() * 10)

A2.Text = Int(Rnd() * 10)

A3.Text = Int(Rnd() * 10)

A4.Text = Int(Rnd() * 10)

A5.Text = Int(Rnd() * 10)

A6.Text = Int(Rnd() * 10)

A7.Text = Int(Rnd() * 10)

A8.Text = Int(Rnd() * 10)

A9.Text = Int(Rnd() * 10)

A10.Text = Int(Rnd() * 10)

Thanks in Advance



How to generate a random number sequence that is non-repeating in visual basic .net ?


I am writing a matching program, and need 24 objects to randomly appear, each twice, across 48 spaces. I figured the best way for me to do this would be to assign the positions a number 1 through 48. but the problem is I can't find a way to generate a random number sequence in visual basic 9 .net

I found many examples in visual basic .net but the conversion doesn't work. If not some code, many some example programs that either use a random number sequence or randomly sets the position of objects.


Sketch Generator

Here is a site where you can generate a sketch of your image online.
An amazing site visit and enjoy this feature :)

Generate Random Numbers

SQL Server has a built-in function that generates a random number, the RAND() mathematical function. The RAND math function returns a random float value from 0 through 1.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Embeb a variable number of videos


I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?

Beginner: this doesn't make sense to me


Do you need and "empty" script tag in the head to run scripts that are in the body?  Also, can you run JQuery scripts if they're in the <head> tag?  The first sample only works if the JQuery script is in the form (and body) tag, not in the head - even if I add $(document).ready(function() { });

This works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
<form id="form1" runat="server">
<a href="">Here is a link</a>
<script type="text/javascript">
$('a').click(function () {
alert("you clicked me!");


This doesn't work.  Notice I removed the second <script> tag from the head

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="serve

Article commenting by line number


I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.

how to make a dropdownlist looks like google search box


dear all...

any idea how to do that ?

Thnx in advance

The number of members in the conceptual type ... does not match with the number of members on the ob



I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error:

The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.

This happens at the following line in global.asax:
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });

Please help!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend