Function

xiaoxiao2021-03-06  44

WHB147 score syndrome section segment of each sector in 9CBS Split level Web development 10038 100 expansion topic 334 100.NET technology 285 100 C / C 30 100 MS-SQL Server 25 100 other database development 5 100 ------------------------------------ -------------------------------------------------- -------------- For a few more time, I saw a lot of people saying how to send a group to the stored procedure, in fact, I have no way, now I only think of a temporary method, with the audience, Hehe, I'm don't do it, we will pass the string, use "," separated, of course, you can also separate TNAME (0) = "WHB147", TNAME (1) = "ray", TNAME (2) = "ACK", you are constructed such as @ TNAME = 'WHB147, ray, Ack,' and then cut in the stored procedure, there is no split in SQL, you have to use other methods to see Charindex can look for Substring can feel a way, huh, huh, can be tested, feasible, the test code is as follows: Copy to the query analyzer running -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ Declare @tname varchar (100) Declare @start intDeclare @end IntDeclare @SUB VARCHAR (100)

Set @ TNAME = 'WHB147, RAY, ACK,' SET @ Start = 0set @end = 1WHILE (@end> 0) Begin set @ start = @ End Select @ End = Charindex (', @tname, @ End 1)

IF (@end> = @Start) begin set @Sub = Substring (@tname, @start, @ End- @ start) set @SUB = Replace (@SUB, ',', '') print @sub covend

--------------------------- Show results WHB147RAYACK -------------------- ------- This is just a temporary method ===================================== == --------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------- author: wxz-- published: 2002-10-25 12:24 : 42

- Collect the custom function of the ASP! This topic is designed for collecting ASP's custom functions. If you have a good custom function in your study, please learn together! It is best to explain the usage. (This borne irrigation) REM Chinese character Judgment Function ischinese (Para) on Error Resume Next Dim Str Dim i if Isnull (Para) Then iSCHINESE = FALSE EXIT FUNCTION END ISCHINESE = FALSE EXIT FUNCTION END IF STR = CSTR (PARA) IF TRIM (STR) = "" " IsChinese = false exit function end if for i = 1 to len (str) c = ASC (MID (STR, I, 1)) IF c> = 0 Then ischinese = false exit function end if next ischinese = true if err.number <> 0 Then Err.clear End Function%>

Such as: if not ischinese (Request ("Name")) "" " "

  • User name should be Chinese characters "Founderr = TrueElse UserName = Trim (Request (" name ") Endiff

    This is simpler for (i = 0; i

    -------------------------------------------------- ----- Generate a non-repetitive number

    Sub Calcapiao () DIM STRCAIPIAONOARR () AS STRINGDIM STRSQL AS STRINGDIM STRCAIPIAONO AS STRINGSTRCAIPIAONO = "01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 "DIM STRTEMPARR (7) AS Stringdim Strzhongjiangarr (7) AS Stringstrcaipiaonoarr = Split ( strCaiPiaoNo, ",") Dim intRand As IntegerDim i As IntegerDim j As Integeri = 0Dim find As BooleanDo While Truefind = FalseRandomizeintRand = Int ((33 * Rnd) 1) For j = 0 To i - 1If StrTempArr (j) = CStr (intRand) Thenfind = TrueEnd IfNextIf Not find ThenStrTempArr (j) = CStr (intRand) strZhongJiangArr (i) = CStr (intRand) 'Text1 (i) = strZhongJiangArr (i) i = i 1If i = 7 ThenExit doEnd IfEnd IfLoopEnd Sub -------------------------------------------------- ------------- author: wxz-- published: 2002-10-2521: 13: 52-- RMB lowercase to uppercase

    <% '**** RMB case transformation format **** DIM STR (9) Str (0) = "zero" STR (1) = "" str (2) = "" str (3) = "" Str (4) = "" str (5) = "Wu" STR (6) = "Lu" STR (7) = "柒" Str (8) = "捌" str (9) = "玖"AA = Request.form (" Source ") HH = FormatNumber (AA, 2, -1) AA = Replace (HH,", "") AA = Replace (aa, ",", ",") for i = 1 to Len (aa) s = MID (AA, I, 1) MyNum = STR (s) SELECT CASE (LEN (AA) 1-I) Case 1: k = mynum & "points" case 2: k = mynum "Corner" case 3: k = mynum & "yuan" case 4: k = mynum & "pick" case 5: k = mynum & "" case 6: k = mynum & "仟" Case 7: k = mynum & "10,000" case 8 : k = mynum & "Pick up" case 9: k = mynum & "" case 10: k = mynum & "仟" end selectm = m & knext%> Digital conversion </ title> <meta http- Equiv = "Content-Type" Content = "text / html; charSet = GB2312"> </ head> <! - elseif (s = ") Thenn = mi = i 2for J = I to Len (aa) S = MID (AA, I, 1) MyNum = STR (s) Select Case (LEN (AA) 1-I) Case 1: P = MyNum & "Division" Case 2: P = MYNUM & "Corner" end selectm = m & pnext -></p> <p><body bgcolor = "# fff"> <form method = "post" name = "forma"> <input type = "text" name = "source" value = "<% = hH%>"> = <input type = "text" name = "resources value =" <% = m%> "SIZE =" 40 "></p> <p><input type = "submit" name = "submit" value = "submit"> </ form> </ body> </ html> -------------------- -------------------------------------------------- - - author: wxz-- published: 2002-11-119: 33: 36-- use regular expressions to write HTML .asp file saved as a separate function, execute, when you grab content with the use ASPHTTP Very cool, of course, I have to improve it "% OPTION Explicit</p> <p>Function striphtml (strHtml) 'Strips the html tags from strHtml</p> <p>Dim objRegexp, stroutputset Objregexp = new regexp</p> <p>ObjregEXP.IGNORECASE = trueObjregExp.global = trueobjregEXP.PATTERN = "<. ?>"</p> <p>'Replace all html tag matches with the empty stringstroutput = Objregexp.replace (strHtml, "")</p> <p>'Replace All <and> with <and> stroutput = Replace (stroutput, "<", "<") stroutput = replace (stroutput, ">", ">")</p> <p>StriPHTML = stroutput 'return the value of stroutput</p> <p>Set objRegexp = Nothingend Function</p> <p>%></p> <p><form method = "post" ID = form1 name = form1> <b> Enter an HTML STRING: </ b> <textarea name = "txthtml" cols = "50" rows = "8" wrap = " Virtual "> <% = Request (" txthtml ")%> </ textarea> <p> <input type =" submit "value =" strip html tags! "ID = Submit1 name = Submit1> </ form></p> <p><% IF LEN ("TXTHTML")> 0 THEN%> <p> <hr> <p> <b> <u> view of string <i> with no </ i> HTML Stripping: </ u > </ b> <XMP> <% = Request ("txthtml")%> </ xmp> <p> <b> <u> view of string <i> with </ i> HTML Stripping: </ u> </ b> <pre> <% = Striphtml (Request ("TXTHTML"))%> </ pre> <% end if%> ----------- -------------------------------------------------- ------------------- - author: wxz-- published: 2002-11-10 15:15:44</p> <p>- How to detect the number of bytes of the note fields differently differentiated by the server, and take different methods: 1.e, Len (RS ("Field")), it will be .le ("Chinese ABC") = 7 2.Z, complicated, LEN ("Chinese ABC") = 5 lenb ("Chinese ABC") = 10, so you need to write a program to determine its length. Function Strlen (STR) DIM i, L, T, C L = LEN (STR) T = L for i = 1 to l C = ASC (MID (STR, I, 1)) IF C <0 THEN C = C 65536 IF C> 255 THEN T = T 1 End If next strlen = t end function ------------------------------------------- --------------------------------------- author: wxz-- published: 2002-12 -10 13:03:57</p> <p>- QQ Online Display Program Core Code <% Function GetURL (URL) Set Retrieval = CreateObject ("Microsoft.xmlhttp") with Retrieval .Open "Get", URL, FALSE, "", "" .send getURL = .responsext END With set retrieval = Nothing end function</p> <p>Function Qqonline (QQID) DIM T, START, LENGTH, PICURL 'Find the source code of the user interface T = getURL ("http://search.tencent.com/cgi-bin/friend/oicq_find? Icicq_no="; & qqid) 'Find Strings ShowResult (position start = INSTR (1, T, "ShowResult (" chr (34))' Find Strings http: // Location Start = INSTR (Start, T, "http: //" ;) 'Finding the length of the string Length = INSTR (Start, T, CHR (34) "," CHR (34)) - start picurl = mid (t, start, length) PIC_Right = Right (Picurl, 5 ) PIC_LEFT = Left (pic_right, 1) IF pic_left = "2" Thenqqonline = "online" elseqonline = "END IFEND FUNCTION%> <% = QQonline (24080411)%> ----------- ---------------------------------------- 1. Οncοntextmenu = "Window.Event.ReturnValue = false "Rightly shield the mouse button <table border οncοntextMenu = return (false)> <TD> NO </ table> can be used for Table2. <body overselectStart =" Return False "> Cancel to prevent copy</p> <p>3. οNPASTE = "Return False" is not allowed to paste</p> <p>4. οNCοPY = "Return False;" oncut = "Return False;" Prevent Copy</p> <p>5. <link rel = "Shortcut icon" href = "favicon.ico"> IE IE IE IE IS</p> <p>6. <link rel = "Bookmark" href = "favicon.ico"> You can display your icon in your favorites</p> <p>7. <Input Style = "IME-MODE: DISABED"> Close input method</p> <p>8. Always bring the framework <script language = "javascript"> <! - if (window == TOP) top.location.href = "frames.htm"; //frames.htm is the framework web page // > </ script></p> <p>9. Prevent people from frame <script language = javascript> <! = Self.location) Top.Location = Self.Location; // -> </ script></p> <p>10. <Noscript> <iframe src = *. Html> </ iframe> <//noscript> page will not be saved as</p> <p>11. <input type = button value = View web source code οnclick = "window.location = 'view-source:' 'http://www.9cbs.net/'"> 12. How to check through ASP Some visitors have used proxy <% if request.servervariables <> "" "" "" "" "" "" "" "" "" & _ "true IP" & Request.ServerVariables "<FF0000> ("Http_x_forwarded_for") End IF%></p> <p>13. Absolute location of the control</p> <p>// javascript <script language = "javascript"> function getie (e) {var t = E.OffSettop; var l = E.Offsetleft; while (e = e.offsetParent) {t = E.OffSettop; L = E. Offsetleft;} alert ("TOP =" T "/ NLEFT =" L);} </ script></p> <p>// vbscript <script language = "vbscript"> <! - function getie () DIM T, L, A, BSET A = Document.all.img1t = Document.all.Img1.offsettopl = document.all.img1.offsetleftWhile A.Tagname <> "body" set a = a.offsetparentt = t a.offsettopl = l a.Offsetleftwendmsgbox "top =" & t & chr (13) & "left =" & l, 64, "Get the position of the control" End Function -> </ script></p> <p>14. The cursor is the last <script language = "javascript" of the text box text, "JavaScript"> Function CC () {var e = Event.srcelement; var r = ev = E.CREATEXTRANGE (); R.MOVESTART ('Character', E. Value.length; r.Collapse (true); r.select ();} </ script> <input type = text name = text1 value = "123" οNFοCUS = "cc ()"></p> <p>15. Judgment the source ASP: Request.ServerVariables ("http_referer")</p> <p>JavaScript: Document.referrer</p> <p>16. Minimize, maximize, close window <Object id = hh1 classid = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <param name = "command" value = "minimize"> </ object> <Object ID = hh2 classid = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11"> <param name = "command" value = "maximize"> </ object> <object id = hh3 classid = "CLSID: ADB880A6-D8FF- 11cf-9377-00aa003b7a11> <param name = "command" value = "close"> </ object> <input type = button value = Minimize οnclick = hh1.click ()> <input type = button value = Maximize οnclick = hh2.click ()> <input type = button value = Off οnclick = hh3.click ()> This example is applicable to IE</p> <p>17. <% 'Define Some constants of the database connection Some constant const adopenforwardnly = 0' cursors only browse records, do not support paging, recordset, bookmarkconst adopenkeyset = 1 'key set cursor, other users have modified to records to records Concentrate, but other users add or delete records will not be reflected in the record set. Support paging, recordset, bookmarkconst adopndynamic = 2 'dynamic cursor function, but the resources are also most. The user will be reflected in the record set. Support full-featured browsing (Access is not supported). Const adopenStatic = 3 'static cursor, just a snapshot of data, users do not reflect the record set, increase or delete records to records. Support forward or backward movement</p> <p>Const AdlockReadOnly = 1 'Lock Type, Default, Read-only, Can't make any modification const adLockPESSIMISTIC = 2' When editing, lock the record immediately, the safest way const axöcktimistic = 3 'is only locked when calling the Update method. Other operations in previous operations can still change, insert, and delete const axöbatchoptimistic = 4 'when editing, while the changes, insert and deletion are completed in batch mode when editing.</p> <p>Const adcmdtext = & h0001const adcmdtable = & h0002%></p> <p>============================================================================================================================================================================================================= ===================== Generate the execl file <! - #include file = .. / inc / connect.asp -> <html> <head> < Meta http-equiv = "content-type" content = "text / html; charset = GB2312"> <title> Download Excel file </ title> </ head></p> <p><body> <% set rs = server.createObject ("adoDb.recordset") DBOPENSQL = Request ("SQL") SQL = Replace (SQL, "| Percentage |", ucase ("%")) Title = Request ("Title") 'response.write sql & "r" rs.open SQL, CONN, 3, 2</p> <p>Set xlapp = server.createObject ("excel.Application") xlapp.visible = falsemet mybook = xlapp.workbooks.addset mysheet = mybook.worksheets (1) MyArray = split (title, "|") 'Add heads for i = 0 to Ubound (MyArray) -1rangex = ucase (chr (65 i)) mysheet.range (Rangex & 1) .value = CSTR (MyArray (i)) Next = Nothing</p> <p>IF = 1do while not = = j 1 'line for i = 0 to rs.fields.count-1if i <26 Thenrangex = ucase (chr (65 i))' response.write Rangex & J & "r n = cstr (rs.fields (i) .value) end ifX & j) (rs.fields (i) .value) end ifxextrs.movenextLoople IF</p> <p>'response.write rs.fields.count & ""' response.write rs.Recordcount & "RandomizemyFileName = session (" UserRealName "& Date () &" - ​​"& cint (rND" * 10000) & ".xls" mypath = server.mappath ("excel.asp") MyArray = split (mypath, "/") mypath = "" for i = 0 to Ubound (myarray) -1mypath = mypath & myarray ( I) & "/"next'Response.write mypath & myfilenamemybook.saveas (mypath & myfilename) mybook.closexlapp.quit</p> <p>Set mysheet = NothingSet mybook = nothingset xlapp = not%> <img src = "../ I / d_wealth_out.gif" Width = "16" height = "16"> <a name = "Download" href = "<% = "Download.asp? filename =" & myfilename%> "> Download <% = myFileName%> </a> </ body> </ html></p> <p>Display the properties of the table --------------------------------------- SELECT table name = case When a.colorder = 1 Then D.Name Else '' end, table description = case when a.colorder = 1 Then ISNULL (F.Value, '') Else '' end, field number = a.colorder, field name = A.NAME, Identification = Case When ColumnProperty (A.ID, A.Name, 'isidentity') = 1 Ten '√'ELSE' 'end, primary key = Case WHEN EXISTS (SELECT 1 from sysobjects where xtype =' pk 'and Name in (Select Name from sysindexes where indid in (select Indid from sysindexkeys where id = a.id and color = a.colid))) "= 'else' 'end, type = B.Name, accounting for bytes = A.LENGTH, length = columnproperty (A.ID, a.name, 'precision "), count number = ISNULL (ColumnProperty (A.ID, A.NAME,' Scale '), 0), Allow empty = Case When A.isnullable = 1 Then '√'ELSE' 'end, default = isnull (e.text,' '), field description = isnull (g. [value],' '), index name = isnull (h. index Name, ''), index order = ISNULL (h. Sort, ') from syscolumns aleft join systemies b on a.xtype = B.XUSERTYPEINNER JOIN SYSOBJECTS D on A.ID = D.ID and D.XTYPE =' U 'and d.status> = 0left join syscomments e on a.cdefault = E.Idleft join sysproperties g on a.id = g.id and a.colid = g.smallid LEFT JOIN SYSPROPERTIES F On D .id = f.id and f.smallid = 0LEFT JOIN (- This section is index information, if you want to display the corresponding relationship between the index and the table and field, you can use the SELECT index name = a.Name, C.ID, D. Colid, Sort = Case IndexKey_Property (C.ID, B. Indid, B.Keyno, 'Isdescending') when 1 Ten 'descended' when 0 Then 'Endfrom sysindexes a.ID = B.ID And A.indid = B.indidJoin (- When there are multiple indexes, the SESINDEXKEYSGROUP BY ID, Colid, COLID, INDID = Min (Indid) b1 on B.ID = B1.ID and B.Colid = b1.colid and b.indid =</p> <p>B1. IndidJoin Sysobjects C on B.ID = C.ID and C.XTYPE = 'u' and C.Status> = 0Join Syscolumns D on B.ID = D.ID and B.Colid = D.Colidwhere A.indid NOT In (0,255)) h on a.id = h.id and a.colid = h.colid - where d.name = 'To query table' - If you only query the specified table, add this condition Order By A . Id, a.colorder ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------ Store process paging technology if exists (select * from sysobjects where id = Object_id ('getRecordFromPage')) Drop Proc GetRecordfromPagego - Get the data code procedure getRecordFromPage @tblname varchardfromPage @tblname varchar (255), - Field name @PageSize Int = 1 @pageIndex int = 1, - Page @PageIndex INT = 1, IScount bit = 0, - Return to the total number of records, non-0 values ​​return @ORDERTYPE bit = 0, - Set the sort type, non-0 value is descended @Strwhere varchar (1000) = '- Query Conditions (Note: Don't Plus Where) Asdeclare @strsql varchar (6000) - Primary Fractor Declare @Strtmp Varchar (100) - Temporary Variable Declare @strorder Varchar (400) - Sort Type</p> <p>IF @ORDERTYPE! = 0BEGIN SET @STRTMP = '<(select min' set @strorder = 'order by [" @fldname "] desc'endelsebegin set @strtmp ='> (Select Max 'set @strorder =' Order By [' @fldname '] asc'end</p> <p>Set @strsql = 'SELECT TOP' STR (@PageSize) '* from [' @TBLNAME '] where [' @fldname ']' @strtmp '([' @fldname '] ) from (SELECT TOP ' STR ((@ PageIndex-1) * @ PageSize) ' [' @fldname '] from [' @TBLNAME '] ' @strorder ') as TBLTMP) ' @strorderif @Strwhere! = '' set @strsql = 'SELECT TOP' STR (@PageSize) '* from [' @TBLNAME '] where [' @fldname '] @strtmp ' ( [' @Fldname ']) from (SELECT TOP ' STR ((@ PageIndex-1) * @ Pagesize) ' [' @fldname '] from [' @tblname '] where ' @ Strword '' @strorder ') as TBLTMP) and' @Strwhere '' @strorder</p> <p>IF @pageindex = 1begin set @strtmp = '' f @Strwhere! = '' set @strtmp = 'Where' @Strwhere</p> <p>Set @strsql = 'SELECT TOP' STR (@PageSize) '* from [' @tblname ']' @strtmp '' @strorder End</p> <p>If @iscount! = 0 set @strsql = 'select count (*) as total from [' @tblname ']'</p> <p>EXEC (@strsql)</p> <p>GO ----------------------------------------------</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-67056.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="67056" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.097</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '_2BZqhb_2Br2zHCJWbtYsJ1aqh2uUtYQRw9_2Fz84CRObPAYb9tUJ4fldZG65fi0Xz3Iezcu4NuLuA1P1fgFjdqT7X8Q_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>