|
|
#51 (permalink) |
|
Üyelik Tarihi: 26.09.2000
Yer: istanbul
Mesaj: 251
|
Re: ASP Fonksiyon Kütüphanesi
Bir fonksiyona ihtiyacım vardı ilk olarak bu sayfa aklıma geldi buraya baktım aradığımı bulamadım başka forumlara baktım oralardada bulamadım. Mutlaka vardır fakat bulamadım belki işinize yarar.. Çok acil yazılmış bir fonksiyon ama her hangi bi sorunla karşılaşmadım.. UZUN KELİMELERİ AYIRMAYA YARIYOR.. Kod:
DIM GELEN_KELIME, AYR_KELIME GELEN_KELIME ="MerhaBA ÇOKKKKKKMMMMMMLLMMMMMMMLÝLEMUKEÝAMLYUÝEKAYUMLÝEAK" AYR_KELIME = 15 FUNCTION METINBOL(GELEN) MARRAY = SPLIT(GELEN, " ") : TOPKELIME = UBOUND(MARRAY,1) FOR I = 0 TO TOPKELIME KUZUN = LEN(MARRAY(I)) IF KUZUN > AYR_KELIME THEN BAS = 1 : BIT = AYR_KELIME FOR J = 1 TO (KUZUN/AYR_KELIME)+1 RESPONSE.WRITE MID(MARRAY(I),BAS,BIT) & " " BAS = BAS + AYR_KELIME : IF BIT + AYR_KELIME < AYR_KELIME THEN BIT = BIT + AYR_KELIME ELSE BIT = AYR_KELIME NEXT ELSE RESPONSE.WRITE MARRAY(I) & " " END IF NEXT END FUNCTION Kullanımı: Kod:
<% METINBOL(GELEN_KELIME) %>
__________________
khssi.. |
|
|
|
|
|
#52 (permalink) |
|
Üyelik Tarihi: 26.09.2000
Yer: istanbul
Mesaj: 251
|
Re: ASP Fonksiyon Kütüphanesi
Gelen Değer YTL ye uygunmu kontrol eder..
Kod:
<%
FIYAT1 = "5.77" 'YTL = TRUE
FIYAT2 = "5.988" 'YTL = FALSE
FIYAT3 = "5.98.8" 'YTL = FALSE
FIYAT4 = "5" 'YTL = TRUE
FIYAT5 = "5.6" 'YTL = TRUE
'-----------------------------------------------------------------------------
'Yazan: kuen, mail: kuen@webdersleri.com, 30 Aralık 2004
'-----------------------------------------------------------------------------
FUNCTION YTL(GELEN) 'GELEN DEĞERİN YTL YE UYGUN OLUP OLMADIĞINI KONTROL EDER.
DIM KL 'KULLANILABİLİR KARAKTERLER
DIM GL '
DIM GC 'KAYIT GECERLİMİ
DIM DG 'KARAKTERLER TEK TEK TUTULUR
KL = ARRAY("0","1","2","3","4","5","6","7","8","9",".")
GL = LEN(GELEN)
IF GL > 0 THEN
'GELEN TUTARIN İÇİNDEKİ KARAKTERLERE TEK TEK BAKAR "KL" ARRAYINDA
'BU KARAKTERLER VARMI KONTROL EDER.
FOR I = 1 TO GL STEP 1
DG = MID(GELEN,I,1)
FOR J = 0 TO 10 STEP 1
IF DG = KL(J) THEN GC = TRUE : EXIT FOR ELSE GC = FALSE
NEXT
IF GC = FALSE THEN EXIT FOR
NEXT
'NOKTADAN SONRA İKİ KARAKTER VARMI KONTROL EDER.
IF GC = TRUE THEN
YTLARY = SPLIT(GELEN, ".", -1, 1)
IF UBOUND(YTLARY,1) = 0 THEN
ELSEIF UBOUND(YTLARY,1) = 1 THEN
IF LEN(YTLARY(1)) > 2 THEN GC = FALSE
ELSE
GC = FALSE
END IF
END IF
ELSE
GC = FALSE
END IF
YTL = GC
END FUNCTION
'--------------------------
'KULLANIMI
'--------------------------
RESPONSE.WRITE YTL(FIYAT1)
'--------------------------
%>
__________________
khssi.. Mesaj Kuen tarafından 30.12.2004 (11:40) yeniden düzenlendi.. |
|
|
|
|
|
#53 (permalink) |
|
Mesaj: n/a
|
Re: ASP Fonksiyon Kütüphanesi
Bu da en basitinden recordset açma şeysi;
Kod:
private function ConnectDB(DBPath) '// şu an için msaccess db set ConnectDB = server.CreateObject("ADODB.Connection") ConnectStr = "Provider='Microsoft.Jet.OLEDB.4.0'; Data Source='" & server.MapPath(DBPath) & "';" ConnectDB.Open ConnectStr end function set cnnSystem = ConnectDB("databases/system.mdb") Kod:
function openObj(objName, strSqlText)
set objName = server.createobject("ADODB.Recordset")
objName.cursortype = 0
objName.cursorlocation = 2
objName.locktype = 1
strSQL = strSqlText 'burada içine başka bişiler serpiştirilebilir.
objName.open StrSQL, cnnSystem, 1,3
end function
Kod:
call openObj(objAyarlar,"SELECT * FROM tblSiteAyar") |
|
|
|
#57 (permalink) |
|
Re: ASP Fonksiyon Kütüphanesi
Sunucudaki Yuklu Bileşenleri kontrol eden fonksiyon(61 bileşeni kontrol ediyor)
.ASP olarak kaydedip sunucuya atın yeterli Kod:
<%@Language="VBScript"%> <% Option Explicit On Error Resume Next Response.Buffer = True server.ScriptTimeout = 1200 Dim theComponent(61) Dim theComponentName(61) '=============================================================================== ' COMPONENT Listesi '=============================================================================== theComponent(0) = "CDONTS.NewMail" theComponent(1) = "SMTPsvg.Mailer" theComponent(2) = "SMTPsvg.Mailer" theComponent(3) = "AspImage.image" theComponent(4) = "POP3svg.Mailer" theComponent(5) = "AspNNTP.Conn" theComponent(6) = "AspFile.FileObj" theComponent(7) = "AspConv.Expert" theComponent(8) = "AspHTTP.Conn" theComponent(9) = "AspDNS.Lookup" theComponent(10) = "AspMX.Lookup" theComponent(11) = "WaitFor.Comp" theComponent(12) = "LastMod.FileObj" theComponent(13) = "ImgSize.Check" theComponent(14) = "GuidMakr.GUID" theComponent(15) = "ASPsvg.Process" theComponent(16) = "AspPing.Conn" theComponent(17) = "AspInet.FTP" theComponent(18) = "ASPExec.Execute" theComponent(19) = "AspCrypt.Crypt" theComponent(20) = "Bible.Lookup" theComponent(21) = "SoftArtisans.SAFile" theComponent(22) = "SoftArtisans.FileManager" theComponent(23) = "SoftArtisans.XFRequest" theComponent(24) = "SoftArtisans.FileManagerTX" theComponent(25) = "SoftArtisans.SASessionPro.1" theComponent(26) = "SMUM.XCheck.1" theComponent(27) = "Softartisans.Archive" theComponent(28) = "SoftArtisans.SMTPMail" theComponent(29) = "Softartisans.ExcelWriter" theComponent(30) = "SoftArtisans.Groups" theComponent(31) = "SoftArtisans.Performance" theComponent(32) = "SoftArtisans.RAS" theComponent(33) = "SoftArtisans.Shares" theComponent(34) = "SoftArtisans.User" theComponent(35) = "Jmail.smtpmail" theComponent(36) = "w3sitetree.tree" theComponent(37) = "w3.upload" theComponent(38) = "w3.netutils" theComponent(39) = "Socket.TCP" theComponent(40) = "w3.netutils" theComponent(41) = "Persits.MailSender" theComponent(42) = "Persits.Upload.1" theComponent(43) = "Persits.Jpeg" theComponent(44) = "Persits.Grid" theComponent(45) = "Persits.AspUser" theComponent(46) = "Persits.CryptoManager" theComponent(47) = "dkQmail.Qmail" theComponent(48) = "Geocel.Mailer" theComponent(49) = "iismail.iismail.1" theComponent(50) = "SmtpMail.SmtpMail.1" theComponent(51) = "ocxQmail.ocxQmailCtrl.1" theComponent(52) = "CalendarCom.CalendarStuff" theComponent(53) = "dgEncrypt.Key" theComponent(54) = "dgFileUpload.dgUpload" theComponent(55) = "dgReport.Report" theComponent(56) = "dgSort.QuickSort" theComponent(57) = "dgTree.Tree" theComponent(58) = "Dundas.Mailer" theComponent(59) = "Dundas.PieChartServer.2" theComponent(60) = "Dundas.Upload" theComponent(61) = "EasyMail.SMTP.5" '=============================================================================== 'THIS IS THE PART THAT GENERATES THE LINKS ON INSTALLED OBJECTS. IT CAN BE ADDED TO OR CHANGED. '=============================================================================== theComponentName(0) = "<a href=""http://www.Microsoft.com"">CDONTS/Chili!mail (freeware)</a>" theComponentName(1) = "<a href=""http://www.serverobjects.com"">server Objects - ASPMail (Commercial Component)</a>" theComponentName(2) = "<a href=""http://www.serverobjects.com"">server Objects - ASPQMail (Commercial Component)</a>" theComponentName(3) = "<a href=""http://www.serverobjects.com"">server Objects - ASPImage (Commercial Component)</a>" theComponentName(4) = "<a href=""http://www.serverobjects.com"">server Objects - ASPPop3 (Commercial Component)</a>" theComponentName(5) = "<a href=""http://www.serverobjects.com"">server Objects - AspNNTP (Commercial Component)</a>" theComponentName(6) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspFile (Commercial Component)</a>" theComponentName(7) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspConv (Commercial Component)</a>" theComponentName(8) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspHTTP (Commercial Component)</a>" theComponentName(9) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspDNS (Commercial Component)</a>" theComponentName(10) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspMX (Commercial Component)</a>" theComponentName(11) = "<a href=""http://www.serverobjects.com"">ServerObjects - Waitfor (freeware)</a>" theComponentName(12) = "<a href=""http://www.serverobjects.com"">ServerObjects - Last Modified (freeware)</a>" theComponentName(13) = "<a href=""http://www.serverobjects.com"">ServerObjects - image Size (freeware)</a>" theComponentName(14) = "<a href=""http://www.serverobjects.com"">ServerObjects - GUID Maker (freeware)</a>" theComponentName(15) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspProc (freeware)</a>" theComponentName(16) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspPing (freeware)</a>" theComponentName(17) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspInet (freeware)</a>" theComponentName(18) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspExec (freeware)</a>" theComponentName(19) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspCryp (freeware)</a>" theComponentName(20) = "<a href=""http://www.serverobjects.com"">ServerObjects - AspBible (freeware)</a>" theComponentName(21) = "<a href=""http://www.softartisans.com"">SoftArtisians Fileup</a>" theComponentName(22) = "<a href=""http://www.softartisans.com"">SoftArtisians FileManager</a>" theComponentName(23) = "<a href=""http://www.softartisans.com"">SoftArtisians X-File</a>" theComponentName(24) = "<a href=""http://www.softartisans.com"">SoftArtisians FileManagerTX</a>" theComponentName(25) = "<a href=""http://www.softartisans.com"">SoftArtisans SA-Session Pro</a>" theComponentName(26) = "<a href=""http://www.softartisans.com"">SoftArtisians Check (form validator)</a>" theComponentName(27) = "<a href=""http://www.softartisans.com"">SoftArtisans Archive</a>" theComponentName(28) = "<a href=""http://www.softartisans.com"">SoftArtisans SMTPmail</a>" theComponentName(29) = "<a href=""http://www.softartisans.com"">SoftArtisans Excel Writer</a>" theComponentName(30) = "<a href=""http://www.softartisans.com"">SoftArtisans.Groups (SA-Admin)</a>" theComponentName(31) = "<a href=""http://www.softartisans.com"">SoftArtisians.Performance (SA-Admin)</a>" theComponentName(32) = "<a href=""http://www.softartisans.com"">SoftArtisans.RAS (SA-Admin)</a>" theComponentName(33) = "<a href=""http://www.softartisans.com"">SoftArtisans.Shares (SA-Admin)</a>" theComponentName(34) = "<a href=""http://www.softartisans.com"">SoftArtisans.User (SA-Admin)</a>" theComponentName(35) = "<a href=""http://www.dimac.net"">w3 JMail</a>" theComponentName(36) = "<a href=""http://www.dimac.net"">w3 site Tree : www.dimac.net" theComponentName(37) = "<a href=""http://www.dimac.net"">w3 Upload</a>" theComponentName(38) = "<a href=""http://www.dimac.net"">w3 Utils</a>" theComponentName(39) = "<a href=""http://www.dimac.net"">w3 Sockets</a>" theComponentName(40) = "<a href=""http://www.dimac.net"">w3 NetDebug</a>" theComponentName(41) = "<a href=""http://www.persits.com"">Persits - ASPEmail</a>" theComponentName(42) = "<a href=""http://www.persits.com"">Persits - ASPUpload</a>" theComponentName(43) = "<a href=""http://www.persits.com"">Persits - AspJpeg</a>" theComponentName(44) = "<a href=""http://www.persits.com"">Persits - AspGrid</a>" theComponentName(45) = "<a href=""http://www.persits.com"">Persits - AspUser</a>" theComponentName(46) = "<a href=""http://www.persits.com"">Persits - AspEncrypt</a>" theComponentName(47) = "dkQMail" theComponentName(48) = "<a href=""http://www.geocel.com/"">GeoCel</a>" theComponentName(49) = "IISMail" theComponentName(50) = "SMTP" theComponentName(51) = "<a href=""http://www.flicks.com"">OCXQMail</a>" theComponentName(52) = "<a href=""http://www.devguru.com"">DevGuru - dgcalendar</a>" theComponentName(53) = "<a href=""http://www.devguru.com"">DevGuru - dgEncrypt</a>" theComponentName(54) = "<a href=""http://www.devguru.com"">DevGuru - dgFileup</a>" theComponentName(55) = "<a href=""http://www.devguru.com"">DevGuru - dgReport</a>" theComponentName(56) = "<a href=""http://www.devguru.com"">DevGuru - dgSort</a>" theComponentName(57) = "<a href=""http://www.devguru.com"">DevGuru - dgTree</a>" theComponentName(58) = "<a href=""http://www.dundas.com"">Dundas - ASPMailer</a>" theComponentName(59) = "<a href=""http://www.dundas.com"">Dundas - Pie Chart server Control 2.0</a>" theComponentName(60) = "<a href=""http://www.dundas.com"">Dundas - Upload</a>" theComponentName(61) = "<a href=""http://www.quiksoft.com"">Quicksoft - EasyMail</a>" Function IsObjInstalled(strClassString) On Error Resume Next ' initialize default values IsObjInstalled = False Err = 0 ' testing code Dim xTestObj Set xTestObj = server.CreateObject(strClassString) If 0 = Err Then IsObjInstalled = True ' cleanup Set xTestObj = Nothing Err = 0 End Function %> <HTML> <HEAD> <TITLE>COMCOM BY SAM MOSES</TITLE> <style type="text/CSS"> <!-- td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; border-color: black black #000000; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px} body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; background-color: #FFFFFF; color: #000000; cursor: default} table { border: #000000; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px} strong { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 24px} --> </style> </HEAD> <BODY> <p align="left"><strong>Component Report Utility:</strong></p> <table border=0 cellspacing=0 cellpadding=4 width="700"> <% Dim i2 For i2=0 to UBound(theComponent) %> <% If IsObjInstalled(theComponent(i2)) Then %> <tr> <td bgcolor="#FFFFFF" align="" A0B0E0"" center width="581"""> <%=theComponentName(i2)%> </td> <td bgcolor="#009900" align="" A0B0E0"" right width="100"""> <div align="right"><b><font color="#FFFFFF">Kurulu</font></b></div> </td> </tr> <% End If %> <% Response.Flush() Next %> <% Dim i For i=0 to UBound(theComponent) %> <% If not IsObjInstalled(theComponent(i)) Then %> <tr> <td bgcolor="#FFFFFF" align="" A0B0E0"" center width="581"""> <%=theComponentName(i)%> </td> <td align="" A0B0E0"" right width="100"""> <div align="right"><font color="#FF0000"><b>Kurulu Degil</b></font></div> </td> </tr> <% End If %> <% Response.Flush() Next %> </table> <br> </BODY> </HTML>
__________________
Makale || Matematik yalan söylemez. || ArtDusunce || differentiate yourself from others. |
|
|
|
|
| Sponsorlu Bağlantılar | |
|
Zoque.Forum
Reklam
|
|
Zoque'a hoşgeldiniz!