31 Ekim 2018 Çarşamba

c# random kullanımı next vs

Random rnd=new Random();
Buradaki yarattığımız nesnenin adı rnd. Şimdi bu nesne üzerinden Random sınıfının metotlarına erişebileceğiz.
 int RastgeleSayi1=rnd.Next(10,20);
 int RastgeleSayi2=rnd.Next(50);
 int RastgeleSayi3=rnd.Next();
 double RastgeleSayi4=rnd.NextDouble();
Birinci örnekte: 10 ile 20 arasında int türden rastgele bir sayı üretilir, 10 dâhil ancak 20 dâhil değildir.
İkinci örnekte: 0 ile 50 arasında int türden rastgele bir sayı üretilir, 0 dâhil ancak 50 dâhil değildir.
Üçüncü örnekte: int türden pozitif herhangi bir sayı üretilir.
Dördüncü örnekte: double türden 0.0 ile 1 arasında rastgele bir sayı üretilir.

25 Ekim 2018 Perşembe

c# image download

You may use the following method to retrieve the image from a specific URL on the web. The below C# function takes an image url, download the image from the url as a stream.

 [insert_adsense]