The simple implementation of Js2word/html2word is described in C # as follows: StringBuilder SB = new StringBuilder ();Sb. Append ("Sb. Append ("xmlns:o= ' Urn:schemas-microsoft-com:office:office '");Sb. Append ("xmlns:w= ' Urn:schemas-microsoft-com:office:word '");Sb. Appen
1. Define an interface for reflectionPublic interface irunexpression{Hashtable mainrun (bool isdebug );Int precision{Set; get ;}}
2. Generate the DLL of the database content. Here, the content is first written to death and can be read directly from the database.Stringbuilder _ sb = new stringbuilder ();// Load reference_ Sb. append ("using system; \ r \ n ");_ Sb
The following class is found on the network because it often involves writing JS pop-up warning dialog boxes when writing background programs:
/####################################### #####Copyright:The content of this article is edited on this site. You can reprint, publish, and use it as needed. However, please note the original source and this statement in plain text.Http://www.opent.cnAuthor: langtaosha######################################## ####/
Using system;Using system. Data;Using syste
Using System;
Using System.Data;
Using System.Configuration;
Using System.Web;
Using System.Web.Security;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.WebControls.WebParts;
Using System.Web.UI.HtmlControls;
Using System.Text;
Namespace EC
{
General method of information output
public class Messageobject
{
General output
public static void Write (String str)
{
System.Web.HttpContext.Current.Response.Write (str);
}
Show a custom output code
public static void Showjs (S
)
-----------------------------7DA119C1004A6
Content-disposition:form-data; Name= "IMAGE0"; Filename= "E:\CAI\875.jpg"
Content-type:image/pjpeg
[File contents]
-----------------------------7da119c1004a6--at the end.
With the above data for reference, organize the data according to its format, post to the server, can also achieve the effect of HTML form submission. To pay special attention to its format: such as carriage return line, the poor one may not get the correct response, as well as
strings more frequently then use StringBuilder.String a1 = "abc"; Allocates a fixed memory size a1+= "DEF"; Create a new memory allocation A1, the cost is more expensive StringBuilder SB = new StringBuilder (20); Specifies the allocation size of SB. Append (' abc '); Assigned to the heap area sb. Append (' Def '); is not destroyed, but is appended directly t
as it is complex enough.
The post code for sending the file is as follows:
String [] props =... // field nameString [] values =... // Field ValueByte [] file =... // File ContentString boundary = "--------------------------- 7d4a6d158c9"; // delimiterStringbuffer sb = new stringbuffer ();// Send each field:For (INT I = 0; ISB = sb. append ("--");SB =
Http://www.cnblogs.com/zhjp11/archive/2010/02/26/1674227.html
Today, when we look at algorithm analysis, we can see a problem where we can find the largest K value in a pile of data.
The name is: design a group of N numbers, and determine the maximum value of K. This is a selection problem. Of course, there are many ways to solve this problem. I searched for it online, the following method is recommended.
The so-called "Nth (first) K large number problem" refers to finding the Nth (first) Order
it is complex enough.
The post code for sending the file is as follows:
String [] props =... // field nameString [] values =... // Field ValueByte [] file =... // File ContentString boundary = "--------------------------- 7d4a6d158c9"; // delimiterStringbuffer sb = new stringbuffer ();// Send each field:For (INT I = 0; ISB = sb. append ("--");SB =
backupath = new File (sqlpath );
If (! Backupath. exists ()){
Backupath. mkdir ();
}
StringBuffer sb = new StringBuffer ();
Sb. append (mysqlpaths );
Sb. append ("mysqldump ");
Sb. append ("-- opt ");
Sb. append ("-h ");
Sb. ap
'ele.text= ' very handsome 'Country.append (Ele)Country.remove (year)Tree.write (' B.xml ')Third, re module (regular)Regular---are most commonly used in reptiles; other modules can be used to import help clear data when using crawlers, while regular is also available in other areasImport rePrint (Re.findall (' \w ', ' ab 12\+-*_ '))Print (Re.findall (' \w ', ' ab 12\+-*_ '))Print (Re.findall (' \s ', ' ab \r1\n2\t\+-*_ '))Print (Re.findall (' \s ', ' ab \r1\n2\t\+-*_ '))Print (Re.findall (' \d
assign the required regular expression to the pattern class:
Patterncompiler orocom=new Perl5compiler ();
Pattern Pattern=orocom.compile ("REGULAR EXPRESSIONS");
Patternmatcher matcher=new Perl5matcher ();
But in the Java.util.regex package, we only need to generate a pattern class, the direct use of its compile () method can achieve the same effect:
Pattern p = pattern.compile ("[/]+");
So it seems that Java.util.regex's construction method is simpler and easier to understand than Jakarta-oro.
fewEntityclass to describe the, Rssentitythe file containsrssentity,rssimage,rssitem3a class,for the entireRSSthe data is encapsulated. Entityextersionsclass provides a set of extension methods to implement an entity-rss XMLConversion of Data,specificentityextersionsthe code below: PublicStaticstringtoxmlstring ( ThisRssItem Item){StringBuilder sb = new StringBuilder ();Sb. Appendline ("");
, deleting, and replacing strings
The sample file Test.txt is the source of the string. The following code reads text in Unicode format. Make sure that the file is saved in a read-time format. For example, Notepad allows code to be saved as Unicode:
Aaaaaaaa,bbbbbbbb,cccccc
Dddddddd,eeeeeeee,ffffff
Gggggggg,hhhhhhhh,iiiiii
Jjjjjjjj,kkkkkkkk,llllll
The following code loads the data and processes the test tools for the data. The test results are sent to the console.
Class Myprocessfile
{
static vo
, including the last row. If you use the Sniffer program to check the POST request sent by IE, you can find that the IE separator is similar to ------------------------- 7d4a6d158c9, which is a random number generated by IE, the purpose is to prevent the server from correctly identifying the start position of a file due to a separator in the uploaded file. We can write a fixed separator as long as it is complex enough.
The POST code for sending the file is as follows:
String [] props =... // fie
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.