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
header code with a table line, and export the excel with the table line smoothly.
The added code is as follows:
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /// /// Excel Header/// /// PublicStaticString addexcelhead () { = New Stringbuilder ();SB. append (""URN: Schemas-Microsoft-COM: Office: Excel \">" );SB. append ("" );
The following is a self-compiled Asp.net paging method. I hope to give you more instructions.Public static stringbuilder pagebtn (INT currentpage, int numinoneline, string URL, pageddatasource PPS) // returns the index string. numinoneline indicates the number of indexes per row, and currentpage indicates the current page;{Stringbuilder sb = new stringbuilder ();Int currentline; // The current index row.
If (currentpage % numinoneline! = 0) // determ
= "title"
\ R \ n
Today
-- ABCD
Content-Disposition: Form-data; name = "1.txt"; filename =" C: \ 1.txt"
Content-Type: text/plain
\ R \ n
-- ABCD --
\ R \ n
Note that each row must end with \ r \ n, including the last row.
If you use snifferProgramCheck the POST request sent by IE. It can be found 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
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 information output method
/// Public class MessageObject
{
/// /// General output
/// /// Public static void Write (string str)
{
System. Web. HttpContext. Current. Response. Write (str );
}
/// /
, 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
Package com. tianren. util;Import java. util. Random;/*** Randomstring. Java* Utils class* @ Author jinxx* @ Version 1.0**/Public class randomstring {/** Returns an uppercase random letter string */Public static string getrandomstringu (INT length ){String STR = "abcdefghijklmnopqrstuvwxyz ";Random random = new random ();Stringbuffer sb = new stringbuffer ();For (int I = 0; I Int number = random. nextInt (26 );Sb
An example of a parent-child process synchronizing data with semaphores allows the parent-child process to print information alternately. # Include ltstdio. H gt # include ltstdlib. H gt # include ltsys/types. H gt # include ltsys/IPC. H gt # include ltsys/SEM. H gt # include ltsys/STAT. H gt # define verifyerr (a, B) \ if (a) {fprintf (stderr, "% s failed. \ n ", B); exit (1);}/* this Union copy from/usr/include/bits/SEM. H */Union semun {int val; struct semid_ds * Buf; unsigned sho
Example Portal: caioj1177
KMP Template: Whether the substring appears"Test Instructions"there are two strings of SA and sb,sa that are female strings, and SB is a substring, asking if a substring of SB has appeared in the parent string SA. output "NO" if the start and end position of the first occurrence of the output has occurred"Input File"First line SA (
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.