C#-এ Uri.IsBaseOf() পদ্ধতিটি বর্তমান Uri ইন্সট্যান্স নির্দিষ্ট Uri ইন্সট্যান্সের ভিত্তি কিনা তা নির্ধারণ করতে ব্যবহৃত হয়।
সিনট্যাক্স
নিচের সিনট্যাক্স −
public bool IsBaseOf (Uri uri);
উপরে, প্যারামিটার Uri হল পরীক্ষা করার জন্য নির্দিষ্ট Uri দৃষ্টান্ত।
উদাহরণ
আসুন এখন Uri.IsBaseOf() পদ্ধতি -
প্রয়োগ করার জন্য একটি উদাহরণ দেখিusing System;
public class Demo {
public static void Main(){
Uri newURI1 = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI1);
Uri newURI2 = new Uri("https://www.tutorialspoint.com/");
Console.WriteLine("URI = "+newURI2);
if(newURI1.Equals(newURI2))
Console.WriteLine("Both the URIs are equal!");
else
Console.WriteLine("Both the URIs aren't equal!");
if(newURI1.IsBaseOf(newURI2))
Console.WriteLine("newURI1 is the base address");
else
Console.WriteLine("newURI1 isn't the base address");
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেURI = https://www.tutorialspoint.com/index.htm URI = https://www.tutorialspoint.com/ Both the URIs aren't equal! newURI1 is the base address
উদাহরণ
Uri.IsBaseOf() পদ্ধতি -
প্রয়োগ করার জন্য এখন আরেকটি উদাহরণ দেখা যাকusing System;
public class Demo {
public static void Main(){
Uri newURI1 = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI1);
Uri newURI2 = new Uri("https://www.qries.com/");
Console.WriteLine("URI = "+newURI2);
if(newURI1.Equals(newURI2))
Console.WriteLine("Both the URIs are equal!");
else
Console.WriteLine("Both the URIs aren't equal!");
if(newURI1.IsBaseOf(newURI2))
Console.WriteLine("newURI1 is the base address");
else
Console.WriteLine("newURI1 isn't the base address");
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেURI = https://www.tutorialspoint.com/index.htm URI = https://www.qries.com/ Both the URIs aren't equal! newURI1 isn't the base address