Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore ASP-VBSCRIPT-SQL

ASP-VBSCRIPT-SQL

Published by ekrem oğuz özafşar, 2016-03-23 05:03:05

Description: ASP-VBSCRIPT-SQL

Search

Read the Text Version

101  <% fname=\"header.inc\" %> <!--#include file=\"<%fname%>\"-->  ÇALIŞMAZ Fırat Üniversitesi - Mustafa ULAŞ

102  YANLIŞ  <% For i = 1 To n <!--#include file=\"count.inc\"--> Next %>  DOĞRU  <% For i = 1 to n %> <!--#include file=\"count.inc\" --> <% Next %> Fırat Üniversitesi - Mustafa ULAŞ

Fırat Üniversitesi - Mustafa ULAŞ 103GLOBAL.ASA

Global.asa104  <script language=\"vbscript\" runat=\"server\">Sub Application_OnStartApplication(\"visitors\")=0End SubSub Session_OnStartApplication.LockApplication(\"visitors\")=Application(\"visitors\")+1Application.UnLockEnd SubSub Session_OnEndApplication.LockApplication(\"visitors\")=Application(\"visitors\")-1Application.UnLockEnd Sub</script> Fırat Üniversitesi - Mustafa ULAŞ

105  <html> <head> </head> <body> <p>There are <%response.write(Application(\"visitors\"))%> online now!</p> </body> </html> Fırat Üniversitesi - Mustafa ULAŞ

Fırat Üniversitesi - Mustafa ULAŞ 106RESPONSE / REQUEST

Response107  Write  Burffer  Flush  Clear  End  Expires  ExpiresAbsolute  IsClientConnected  ContentType  Charset Fırat Üniversitesi - Mustafa ULAŞ

Response Properties108 Property Description Buffer Specifies whether to buffer the page output or not CacheControl Sets whether a proxy server can cache the output Charset generated by ASP or not ContentType Appends the name of a character-set to the content-type header in the Response object Sets the HTTP content type for the Response object Expires Sets how long (in minutes) a page will be cached on a browser before it expires ExpiresAbsolute Sets a date and time when a page cached on a browser will expire IsClientConnecte Indicates if the client has disconnected from the d server Pics Appends a value to the PICS label response header Status Specifies the value of the status line returned by the serverFırat Üniversitesi - Mustafa ULAŞ

Response Methods109 Description Method Adds a new HTTP header and a value to the HTTP AddHeader response AppendToLog Adds a string to the end of the server log entryBinaryWrite Writes data directly to the output without any character conversionClearEnd Clears any buffered HTML outputFlush Stops processing a script, and returns the current result Sends buffered HTML output immediatelyRedirect Redirects the user to a different URLWrite Writes a specified string to the output Fırat Üniversitesi - Mustafa ULAŞ

Response.write110 Fırat Üniversitesi - Mustafa ULAŞ

Response.redirect111 Fırat Üniversitesi - Mustafa ULAŞ

Response.redirect112 Fırat Üniversitesi - Mustafa ULAŞ

Response.buffer - flush113 Fırat Üniversitesi - Mustafa ULAŞ

Response.buffer - flush114 Fırat Üniversitesi - Mustafa ULAŞ

Response.end115 Fırat Üniversitesi - Mustafa ULAŞ

Response.expires116 Fırat Üniversitesi - Mustafa ULAŞ

Response.Charset117 Fırat Üniversitesi - Mustafa ULAŞ

Response.Charset118 Fırat Üniversitesi - Mustafa ULAŞ

Request.form119 Fırat Üniversitesi - Mustafa ULAŞ

Request.form120 Fırat Üniversitesi - Mustafa ULAŞ

Request.QueryString121 5.asp 5_islem.asp Fırat Üniversitesi - Mustafa ULAŞ

Request.QueryString122 Fırat Üniversitesi - Mustafa ULAŞ

Request.ServerVariables123 Fırat Üniversitesi - Mustafa ULAŞ

Request.ServerVariables124 Fırat Üniversitesi - Mustafa ULAŞ

Fırat Üniversitesi - Mustafa ULAŞ 125SERVER

ASP CreateObject Method126  Sunucuda tanımlı kompanentleri asp dosyasında kullanılması için kullanılır.  <% Set cn=Server.CreateObject(“ADODB.Connection\") %> Fırat Üniversitesi - Mustafa ULAŞ

ASP Execute Method127  Execute ile çağrılan dosyayı sunucuda çalıştırır. HTML olarak asıl asp dosyasına ekler.  Dosya1.asp: <% response.write(“Burası Dosya 1!<br />\") Server.Execute(\"Dosya2.asp\") response.write(“Dosya 1’e geri döndüm!\") %> Dosya.asp: <% response.write(\"Burası Dosya 2!<br />\") %> Ekran Çıktısı: Burası Dosya 1! Burası Dosya 2! Dosya 1’e geri döndüm! Fırat Üniversitesi - Mustafa ULAŞ

ASP MapPath Method128  Dosya adresini geri döndürür.  <% response.write(Server.MapPath(\"test.asp\") & \"<br />\") response.write(Server.MapPath(\"script/test.asp\") & \"<br />\") response.write(Server.MapPath(\"/script/test.asp\") & \"<br />\") response.write(Server.MapPath(\"\script\") & \"<br />\") response.write(Server.MapPath(\"/\") & \"<br />\") response.write(Server.MapPath(\"\\") & \"<br />\") %>  Ekran Çıktısı: c:\inetpub\wwwroot\script\test.asp c:\inetpub\wwwroot\script\script\test.asp c:\inetpub\wwwroot\script\test.asp c:\inetpub\wwwroot\script c:\inetpub\wwwroot c:\inetpub\wwwroot Fırat Üniversitesi - Mustafa ULAŞ

ASP URLEncode Method129  <% response.write(Server.URLEncode(\"http://www.w3schools.com\")) %> Ekran Çıktısı: http%3A%2F%2Fwww%2Ew3schools%2Ecom Fırat Üniversitesi - Mustafa ULAŞ

ASP HTMLEncode Method130  <% response.write(Server.HTMLEncode(\"The image tag: <img>\")) %> Ekran Çıktısı: The image tag: &lt;img&gt; Web browser Çıktısı : The image tag: <img> Fırat Üniversitesi - Mustafa ULAŞ

Rastgele Sayı<% Dim TesadufiSayi Randomize TesadufiSayi = Rnd%>

Fonksiyonlar<%Function YaziTura Dim ParaAt Randomize ParaAt = Int(Rnd * 2) + 1 If ParaAt = 1 Then YaziTura = \"Yazı\" Else YaziTura = \"Tura\" End IfEnd Function%>Bu fonksiyonu, ASP programının herhangi bir yerinden, şöyle bir yöntemle çağırabilir; ve vereceği sonucu programın akışına uygun şekilde kullanabilirsiniz:<%NeGeldi = YaziTuraResponse.Write NeGeldi%>

subrutins<%Sub YaziTura() Dim ParaAt Randomize ParaAt = Int(Rnd * 2) + 1 If ParaAt = 1 Then Response.Write \"Yazı\" Else Response.Write \"Tura\" End IfEnd Sub%>Sub, elde edeceği değeri kendisi kullanacak ve bittiği anda kontrol programa geri dönecektir. Geriye değer döndermez.

Fırat Üniversitesi - Mustafa ULAŞ 134ASP FILESYSTEMOBJECT – DOSYA VEKLASÖR IŞLEMLERI

Asp Dosya Yazma135  <HTML>  <HEAD>  <TITLE>ASP ILE DOSYA YAZMA</TITLE>  <META http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-9\">  <META http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1254\">  </HEAD>  <BODY>  <%  Dim YaziFSO, yaz  Set YaziFSO = CreateObject(\"Scripting.FileSystemObject\")  Set yaz = YaziFSO.CreateTextFile(\"c:\yazi_deneme.txt\",True)  yaz.WriteLine(\"Bu bir denemedir.\")  yaz.Close  %>  <H2><CENTER>Bu Web sayfası sabit diske yazı yazdırır!!  <BR>Şimdi C: sürücüsünde yazi_deneme.txt adlı bir dosya olması gerekir!  <BR>Lütfen bakar mısınız?</H2></CENTER>  </BODY>  </HTML> Fırat Üniversitesi - Mustafa ULAŞ

Asp Dosya Silme136  <%  Dim DosyaSistemi  Set DosyaSistemi = CreateObject(“Scripting.FileSystemObject”)  DosyaSistemi.DeleteFile “c:\belgelerim\test.*”  %> Fırat Üniversitesi - Mustafa ULAŞ

Asp Dosya Kopyalama137  Dim DosyaSistemi  Set DosyaSistemi = CreateObject(“Scripting.FileSystemObject”)  DosyaSistemi.CopyFile “c:\belgelerim\*.*”, “c:\yedekler\” Fırat Üniversitesi - Mustafa ULAŞ

Metin Dosyasını Okuma138  <HTML>  <HEAD>  <TITLE>ASP ILE DOSYADAN METİN OKUMA</TITLE>  <META http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1254\">  </HEAD>  <BODY>  <%  Dim DosyaSistemi, MetinDosyasi, Satir  Set DosyaSistemi = CreateObject(\"Scripting.FileSystemObject\")  Set MetinDosyasi = DosyaSistemi.OpenTextFile(\"c:\yazi_deneme.txt\",1, 0)  Do  Satir = MetinDosyasi.ReadLine  %>  <%=Satir%>  <%  Loop Until MetinDosyasi.AtEndOfStream  MetinDosyasi.Close  %>  </BODY>  </HTML> Fırat Üniversitesi - Mustafa ULAŞ

ASP FileSystemObject Object139 Appends a name to an existing path BuildPath Copies one or more files from one location to another CopyFile Copies one or more folders from one location to another CopyFolder Creates a new folder CreateFolder Creates a text file and returns a TextStream object that can be used to read from, or CreateTextFile write to the file Deletes one or more specified files DeleteFile Deletes one or more specified folders DeleteFolder Checks if a specified drive exists DriveExists Checks if a specified file exists FileExists Checks if a specified folder exists FolderExists Returns the complete path from the root of the drive for the specified path GetAbsolutePathName Returns the base name of a specified file or folder GetBaseName Returns a Drive object corresponding to the drive in a specified path GetDrive Returns the drive name of a specified path GetDriveName Returns the file extension name for the last component in a specified path GetExtensionName Returns a File object for a specified path GetFile Returns the file name or folder name for the last component in a specified path GetFileName Returns a Folder object for a specified path GetFolder Returns the name of the parent folder of the last component in a specified path GetParentFolderName Returns the path to some of Windows' special folders GetSpecialFolder Returns a randomly generated temporary file or folder GetTempName Moves one or more files from one location to another MoveFile Moves one or more folders from one location to another MoveFolder OpenTextFile Opens a fileFıarandt ÜrentiuvrenrssaiteTseix-tSMtruesamtafoabUjeLctAtŞhat can be used to access the file

Methods ASP File Object140 Description Property Sets or returns the attributes of a specified file Returns the date and time when a specified file was created Attributes Returns the date and time when a specified file was last accessed DateCreated Returns the date and time when a specified file was last modified DateLastAccessed Returns the drive letter of the drive where a specified file or folder resides DateLastModified Drive Sets or returns the name of a specified file Returns the folder object for the parent of the specified file Name Returns the path for a specified file ParentFolder Returns the short name of a specified file (the 8.3 naming convention) Path ShortName Returns the short path of a specified file (the 8.3 naming convention) ShortPath Returns the size, in bytes, of a specified file Size Returns the type of a specified file Type Method Description Copy Copies a specified file from one location to another Delete Deletes a specified file Move Moves a specified file from one location to another OpenAsTextStream Opens a specified file and returns a TextStream object to access the file Fırat Üniversitesi - Mustafa ULAŞ

ASP Folder Object141 Description Sets or returns the attributes of a specified folder Property Attributes Returns the date and time when a specified folder was created DateCreated DateLastAccessed Returns the date and time when a specified folder was last accessed DateLastModified Drive Returns the date and time when a specified folder was last modified IsRootFolder Name Returns the drive letter of the drive where the specified folder resides ParentFolder Path Returns true if a folder is the root folder and false if not ShortName ShortPath Sets or returns the name of a specified folder Size Type Returns the parent folder of a specified folder Method Copy Returns the path for a specified folder Delete Returns the short name of a specified folder (the 8.3 naming convention) Move CreateTextFile Returns the short path of a specified folder (the 8.3 naming convention) Returns the size of a specified folder Returns the type of a specified folder Description Copies a specified folder from one location to another Deletes a specified folder Moves a specified folder from one location to another Creates a new text file in the specified folder and returns a TextStream object to access the file Fırat Üniversitesi - Mustafa ULAŞ

Fırat Üniversiesi - Mustafa ULAŞ 142SQL - DATABASE ( VERİTABANI )

143 DATABASE ( VERİTABANI )  Database(Veritabanı), kısaca bilgiler topluluğudur.  Bizler, bu bilgiyi değerlendirerek, hızlı ve doğru bir şekilde ulaşabilir ve değişiklik yapabiliriz...  İçinde bulunduğumuz bilgi çağında, database'ler her yerde mevcuttur:  Kitapçıda belli bir kitabı aradığınızda, kitapçının kitap database'ine erişiyorsunuz demektir.  Bankalar, tüm parasal kayıtları kendi database'i üzerinde tutmaktadır. Fırat Üniversiesi - Mustafa ULAŞ

144 Veritabanı Oluşturma ( MS Access ) Fırat Üniversiesi - Mustafa ULAŞ

145 Veritabanı Oluşturma ( MS SQL Server ) Fırat Üniversiesi - Mustafa ULAŞ

Tablo146 Fırat Üniversiesi - Mustafa ULAŞ

147 Tablo İşlemleri ( MS Access ) Fırat Üniversiesi - Mustafa ULAŞ

Temel Kavramlar148  Veritabanı (Database) : İçerisinde tabloları barındırır.  Tablo (Table): En temel yapıdır. Mantıksal olarak her olay veya nesne için bir tablo tanımlamak gerekebilir. Satır ve sütünlardan meydana gelir.  Alan (Field) : Tablonun sütunlarıdır. Her alan nesne veya olayın bir özelliğini belirtir.  Kayıt (Row) : Tablonun her bir satırıdır. Fırat Üniversiesi - Mustafa ULAŞ

Temel Kavramlar - II149  Birincil Anahtar (Primary Key): Nesnenin veya olayın “tekil” olan bir özelliği PK olarak seçilir. İndeksleme ve sıralama gibi tüm işlemler bu alan üzerinden yapılır.  Yabancı Anahtar (Foreign Key): İki tablo arasında ilişki kurmak için kullanılır.  Alan Tipleri : Tam sayı, Gerçek sayı, Alfanumerik, Metin, Tarih, Mantıksal Fırat Üniversiesi - Mustafa ULAŞ

OGR_NO (PK) AD SOYAD SINIF Kurban 35047 Ahmet Çapsız 3 Sarıca 15027 Mehmet5185 BurakID (PK) OGR_NO (FK) DERS_KOD1 5047 BM3012 5047 BM3033 5047 BM3084 5025 BM3015150 5025 BM306Fırat Üniversiesi - Mustafa ULAŞ


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook