TitleImportJava.io.BufferedInputStream;ImportJava.io.BufferedOutputStream;ImportJava.io.FileInputStream;ImportJava.io.FileOutputStream;ImportJava.io.FileReader;ImportJava.io.FileWriter;ImportJava.io.IOException;ImportJava.io.InputStream;ImportJava.io.OutputStream;ImportJava.io.Reader;ImportJava.io.Writer;/ * * Filereader/filewriter class * file character input/output stream */ Public class Test03 { Public Static void Main(string[] args)throwsIOEx
* Copy of text files can be achieved using FileReader and FileWriter.* For non-text files (video files, audio files, pictures), only the byte stream can be used!1 @Test2 Public voidTestfilereader () {3FileReader FR =NULL;4 Try {5File File =NewFile ("Dbcp.txt");6FR =Newfilereader (file);7 Char[] C =New Char[24];8 intLen;9 while(len = Fr.read (c))! =-1){TenString str =NewString (c, 0, Len); One System.ou
The code is as follows
Copy Code
More about the content reference
Ps://developer.mozilla.org/en/dom/filereader ">https://developer.mozilla.org/en/dom/filereader
Using Ajax is not directly uploaded files, is generally a new iframe in it to complete the form submission process to achieve the effect of asynchronous upload files.Doing so can achieve better browser compatibility, but the amount of code will be relatively large, even with the use of file upload plug-ins, such as Plupload.
How can you be flexible enough to treat a file as a normal form parameter like a normal AJAX submission form data?
Flash, the use of JavaScript
= "showfiles ();" /> h4>Select the file as Follows:h4> imgsrc=""ID= "img1" />Div>Js://reading a picture instancevarFilebox = document.getElementById (' file ');functionshowfiles () {//get an array of selected files varFileList =filebox.files; for(vari = 0; I ) { varFile =filelist[i]; //Picture Type verification the second way if(/image\/\w+/. Test (file.type)) readFile (file); ElseConsole.log (file.name+ ': not pictures '); }}//read image content as Dataurl//Reader.readas
4 Main methods:Abort (): Interrupt read.Readasbinarystring (): reads the file as a binary code.Readasdataurl (): reads the file as Dataurl.Readastext (): reads the file as text.Event:Onabort: When interruptedOnError: Error whenOnLoad: Read successOnloadend: Read complete regardless of failure or successOnloadstart: Read startOnProgress: in Read2 Properties:Result: The value is only available after the read succeeds, and no is empty.ReadyState:0: for reading data1: Reading2: CompleteHTML5
Brief introduction
With the FileReader object, a Web application can asynchronously read the contents of a file (or raw data buffer) stored on a user's computer, and you can use a file object or a Blob object to specify the files or data that you want to work with. Where the file object can be from a user in a
More than one page, upload multiple pictures demo code
The above is the entire content of this article, I hope to learn JavaSc
One problem encountered today is that the main menu is placed in an IFRAME, And the link is controlled by JS, that is, the link corresponding to the current page is displayed in red. However, when you click the link in the parent window to replace the content in main, the link in IFRAME remains unchanged. At the beginning, I still wanted to judge through the content in the content display area, but I was not aware of it immediately. Later I wanted to
MFC window, parent window parentwindow, owner window Ownerwindow difference1. Understanding the relationship between Windows 2. How to set (create) a different windowOneParent: Creator, Owner: OwnersXiao Yu's parents gave birth to Jade, raised to 8 years old, sold to Jia Fu when the girlXiao Yu's parents are the parent, Jia is ownerTwo1.pop-up
How to refresh the parent window when closing the window (the window that opened the window is not necessarily an MDI window) is very simple in B/S, however, it is not so easy in winform. Because you cannot open another window whe
Floating layer embedded IFRAME and Frame Collection window, multiple methods to refresh the parent page
JS Code
The code is as follows
Copy Code
Popup child page
JS Code
The code is as follows
Copy Code
child window refreshes parent window
JS Code
The code is as foll
Cross-border easyui window (window) -- limits the range of easyui window activity and window easyui
A problem occurs when easyui window is used. If the window is dragged or changed by hours, it cannot be returned if the
When javascript closes the pop-up window, refresh the parent window and center display window. The javascript window
The moveTO () method is used for center display;
When closing the pop-up window, the window. opener method is use
[Please indicate the source of the post: blog.csdn.net/lanmanck]
It is interesting to embed a child window into the parent window. For example, we use this method to easily implement each interface in the common software installation dialog box. If there is only one form, the control will crash.
VC-MFC can also be implemented, please refer to thisArticle: Http://blog.csdn.net/lanmanck/archive/2009/02/02
12345678910
publicvoidclickReportIcon(){String initialWindowHandle = driver.getWindowHandle();//保存原始的浏览器窗口page.getReportIcon().click();//这个操作之后将会弹出另外一个浏览器窗口Set set.remove(initialWindowHandle);assertset.size()==1;driver.switchTo().window((String) set.toArray()[0]);//将driver指向新弹出的浏览器窗口driver.close();//关闭新弹出的浏览器窗口driver.switchTo().window(initialWindowHandle);//回到原始的浏览器窗口}
[Selenium] through the Sel
1. Create a dialog1 project with VC. Default attribute.
2. Insert a dialog2 and change it to child.
3. Include the dialog2 header file in dialog1 and display dialog2 in a button event:
Cdialog2 * P = new cdialog2 (this );
P-> Create (idd_dialog2 );
P-> setparent (this); // sets dialog1 as the parent window.
P-> showwindow (sw_show );
In this way, dialog2 is embedded in dialog1, which is more convenient than tabcontrol. Many applicationsProgramT
1. Create a dialog1 project with VC. Default attribute.
2. Insert a dialog2 and change it to child.
3. Include the dialog2 header file in dialog1 and display dialog2 in a button event:
Cdialog2 * P = new cdialog2 (this );
P-> Create (idd_dialog2 );
P-> setparent (this); // sets dialog1 as the parent window.
P-> showwindow (sw_show );
In this way, dialog2 is embedded in dialog1, which is more convenient than tabcontrol. Many applicationsProgra
Public void clickreporticon () {string initial?whandle = driver. getwindowhandle (); // Save the original browser window page. getreporticon (). click (); // after this operation, another browser window set
Reference Document: Http://www.cnblogs.com/fwycmengsoft/p/4026592.htmlOneParent: Creator, Owner: OwnersXiao Yu's parents gave birth to Jade, raised to 8 years old, sold to Jia Fu when the girlXiao Yu's parents are the parent, Jia is ownerTwo1.pop-up window: A pop-up window is a window that must have the Ws_popup property, the pop-up
OneParent: Creator, Owner: OwnersXiao Yu's parents gave birth to Jade, raised to 8 years old, sold to Jia Fu when the girlXiao Yu's parents are the parent, Jia is ownerTwo1.pop-up window: A pop-up window is a window that must have the Ws_popup property, the pop-up window can only be a top-level
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.