clipboardIf isclipboardformatavailable (cf_hdrop) thenIf openclipboard (0 ) thenHdrop = getclipboarddata (cf_hdrop)'Get the number of filesNfiles = dragqueryfile (hdrop,-1 , "", 0)Redim files (0 to nfiles-1) as stringFilename = space (max_path)'Confirm that the operation type is copy operationTfstr. wfunc = fo_copy'The destination path is set to the path specified by file1.Tfstr. PTO = form1.file1. PathFor I = 0 to nfiles-1'Copy Objects Based on each obtained FileCall dragqueryfile (hdrop, I, f
number or field name to obtain the field value.
Query. nextRow (); // jump to the next data row
}
8. query. finalize (); // release the Query
9. db. close (); // close the database;
Note that the data obtained after the query, that is, getStringField ();, is utf8 encoded, because I use vc6 and vc6 is ansi by default, so for garbled characters, it is necessary to try transcoding before using it. I wrote a Convert function, but still some minor problems have not been solved, but it does not affec
compression is used to determine the number of identical characters, and then the characters are prefixed with the number, so we can count the characters and splice them again.
Here I come up with two methods,
1: create two lists, one for storing characters, and the other for storing the number of characters. Then, recombine the strings based on the two lists;
2: directly combine strings in the counting process
Here I chose the second approach. I felt that I could write less code and I was too
Question:
Select two people from five as etiquette. The height of each person ranges from 160 to 190, and the height difference between two people is the minimum (if the difference is the same, select the highest two persons), and output the height of the two persons in ascending order.
Smple input: 161 189 167 172 Sample outPut: 188 188
Analysis: My understanding is to first sort the values in reverse order, then compare the height difference one by one, find the minimum height difference, and
Private
Function isvaliddo ()
function isvaliddo ( byval strin as string ) as Boolean return RegEx. ismatch (strin, " ^ ([a-zA-Z0-9] ([a-zA-Z0-9 \-] {} [a-zA-Z0-9])? \.) + [A-Za-Z] {800000 }$ " ) end function
Private
Function isvalidip ()
Function Isvalidip ( Byval Strin As String ) As Boolean Retu
Question:
* Set the phone number to One two... Nine zero is translated into 1 2 .. 9 0** Double exists in the middle.** For example* Input: onetwothree* Output: 123* Input: onetwodoubletwo* Output: 1222* Input: 1two2* Output: Error* Input: doubledoubletwo* Output: Error
Analysis: a good method for string operations is replaceall (). With this method, we can easily translate English into numbers, and the rest is to identify illegal problems, this can be a regular expression, but please forgive t
| NextDate. Length! = 10) OutputAndEnd (str + "stage. The date length is incorrect! ");// HttpContext. Current. Response. Write (FirstDay + "dd" + NextDate );If (! IsValidDate (FirstDay) |! IsValidDate (NextDate )){OutputAndEnd (str + "stage, Date Format incorrect! ");}DateTime One = Convert. ToDateTime (FirstDay );DateTime Two = Convert. ToDateTime (NextDate );
If (One. CompareTo (Two)> 0){OutputAndEnd (str + "stage, the end date is earlier than the start date! ");}}
# Endregion
# Region verif
javax. Script. scriptengine;Import javax. Script. scriptenginemanager;/*** Enter an expression with no parentheses and the number is smaller than 0-9. The calculation result is output. All intermediate results are converted into an integer.Example: input: 3 + 8x2/9-2Output: 2Function prototypePublic int getmyret (string Str)* @ Author wenj91-PC**/Public class testcalceq {Public static void main (string ARGs []) {String strin = "3 + 8x2/9-2 ";Testcalc
judge the number of the same characters, and then the number of characters prefixed, so we can count the characters, and then splicing again
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/
Here I think of two ways,
1: Is to create two list, a storage character, one is the number of characters stored, and then according to the two list to regroup the string;
2: Combine strings directly in the process of counting
Here I choose to be the second way of t
solve the problem.
14,System. Text. regularexpressions. RegEx = new system. Text. regularexpressions. RegEx ("[\ u4e00-\ u9fa5]");String replacedstring = RegEx. Replace (STR, ""); // If a specified encoded string exists, filter it out.The regular expression is used for filtering. I use this code to filter Chinese characters. You can just change it.
15. Extract Chinese Characters
Private void button#click (Object sender, system. eventargs E){If (txtin. Text! = ""){Int I = 0;String
javax. script. ScriptEngine;Import javax. script. ScriptEngineManager;/*** Enter an expression with no parentheses and the number is smaller than 0-9. The calculation result is output. All intermediate results are converted into an integer.Example: input: 3 + 8x2/9-2Output: 2Function prototypePublic int getMyRet (String str)* @ Author wenj91-PC**/Public class TestCalcEq {Public static void main (String args []) {String strIn = "3 + 8x2/9-2 ";TestCalc
compression is used to determine the number of identical characters, and then the characters are prefixed with the number, so we can count the characters and splice them again.
Here I come up with two methods,
1: create two lists, one for storing characters, and the other for storing the number of characters. Then, recombine the strings based on the two lists;
2: directly combine strings in the counting process
Here I chose the second approach. I felt that I could write less code and I was too
'*************************************************************
' In the case of support FSO, you can display the code of all ASP pages in this site
' The code that displays the page directly on the effect page when the code is demonstrated without having to make a special page for the code
' Use method: viewsource.asp?file= the file name to display
' such as: viewsource.asp?file=x.asp
' Modify By:babyt
'*************************************************************
%>
Dim objFSO, Objinfile
Dim
Ni ","Xiao Tong ","Li Lei ","Zhang San"
Run Time Limit: unlimited memory limit: Unlimited
Input: enter a man's name, string
Output: name of the lady with the most "Husband and Wife"
Analysis: From this question, we can also see the heavy shadow, so first final the set, and then judge the number of characters in turn cyclically, so this is also a very simple question, let's talk about the code;
The Code is as follows:
Package com. wenj. test;Import java. util. iterator;Import java. util. linkedh
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.