C# 0 The Complete Reference


Using the LastModified Property



Download 4,07 Mb.
Pdf ko'rish
bet1039/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   1035   1036   1037   1038   1039   1040   1041   1042   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

Using the LastModified Property

Sometimes you will want to know when a resource was last updated. This is easy to find 

out when using 

HttpWebResponse

 because it defines the 



LastModified

 property. It is 

shown here:

public DateTime LastModifi ed { get; }



LastModified

 obtains the time that the content of the resource was last modified.

The following program displays the time and date at which the URI entered on the 

command line was last updated:

/* Use LastModified.

   To see the date on which a website was

   last modified, enter its URI on the command

   line. For example, if you call this program

   LastModifiedDemo, then to see the date of last

   modification for HerbSchildt.com enter

     LastModifiedDemo http://HerbSchildt.com

*/

using System;



using System.Net;

class LastModifiedDemo {

  static void Main(string[] args) {

    if(args.Length != 1) {

      Console.WriteLine("Usage: LastModifiedDemo ");

      return ;

    }

    HttpWebRequest req = (HttpWebRequest)



           WebRequest.Create(args[0]);

    HttpWebResponse resp = (HttpWebResponse)

           req.GetResponse();

    Console.WriteLine("Last modified: " + resp.LastModified);

    resp.Close();

  }


}

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   1035   1036   1037   1038   1039   1040   1041   1042   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish