Document directory
① Allocconsole
② Setconsoletitle
③ Getstdhandle
④ Setconsoletextattribute
⑤ Freeconsole
⑥ Writeconsole
7. readconsole
Design Concept
(1) Allocate the memory resources of the console program.
(2) set relevant properties of the console.
(3) output text content on the console.
(4) receive interaction information and continue output.
(5) r
againconsole.groupAndconsole.groupEndCan bring this classification management idea to the extreme. This is suitable for grouping log information into groups named by their namespaces when developing a large-sized web app with many complicated modules.
Console. group ("app. foo "); console. log ("information from the foo module... "); console. groupend ();
[] args ){
String str = readStringFromDialog ("Enter the String :");
System. out. println ("input of the readStringFromDialog method:" + str );
}
/**
* In the JOptionPane input dialog box, enter a string.
* JDK version used
* @ Param prompt information
* @ Return refers to the input string.
*/
Private static String readStringFromDialog (String prompt ){
Return JOptionPane. showInputDialog (prompt );
}
}
The preceding two methods share a common drawback: they can only read strings. If you want t
:");
SYSTEM.OUT.PRINTLN ("Input of the Readstringfromdialog method:" + str);
}
/**
* Using the Joptionpane Input dialog box, enter the string
* For the JDK version used
* @param prompt prompt information
* @return The input string
*/
private static string Readstringfromdialog (String prompt) {
return Joptionpane.showinputdialog (Prompt);
}
}
Both of the above methods have a common disadvantage--only the strings can be read, and if you need to read other types of data, you need to co
1. Web API Brief DescriptionRecently, many large platforms have exposed web APIs. such as Baidu map Web API, do map related people are familiar. Exposing the service this way makes it easy to integrate functionality with a wide variety of device and client platforms, and to create a richer HTML experience by using JavaScript in the browser. So I believe that the Web API
Label: blog HTTP Io ar use Java SP strong Div
Console API
When you open firebug (which also includes built-in debugging tools for chrome and other browsers), the window will register an object called console. It provides multiple methods to output information to the console for developers to debug and use. The foll
(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );color:transparent;-webkit-background-clip: text;font-size:5em;‘);All kinds of strokes of the rhythm Ah ~Look at the dense code above do not panic, the console.log() second parameter is all pure CSS to control the style, you will not be unfamiliar. In the first argument, you can take an escape instruction that begins with a percent sign, such as the command used to outpu
is
Console corresponds to maincrtstartup or wmaincrtstartup
Windows corresponds to winmain or wwinmain
However, we can also manually change them to make them not match.
For example, we can change it like this.
# Pragma comment (linker,/subsystem: Windows/entry: maincrtstartup) // set the entry address
Int main (INT argc, char * argv [])
{
MessageBox (null, hello, notice, mb_ OK );
Return 0;
}
When the linker sees the Windows option in/subsystem by de
used as the index value of the internal table in windows.
Call the API functions controlled by the relevant text interface. These functions can be divided into three types. 1. functions used for Console window operations (including window buffer size, window foreground characters and background color, window title, size and position ); second, the functions used for co
console.log(‘%chello world‘, ‘background-image:-webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );color:transparent;-webkit-background-clip: text;font-size:5em;‘);
All kinds of strokes of the rhythm Ah ~Look at the dense code above do not panic, the console.log() second parameter is all pure CSS to cont
), color-stop(0.9, #ff2), color-stop(1, #f22) );color:transparent;-webkit-background-clip: text;font-size:5em;‘);All kinds of strokes of the rhythm Ah ~Look at the dense code above do not panic, the console.log() second parameter is all pure CSS to control the style, you will not be unfamiliar. In the first argument, you can take an escape instruction that begins with a percent sign, such as the command used to output a styled text above %c . See the official
1. Get window handle based on class name or window name: http://support.microsoft.com/kb/124103/zh-cn
Win32 API provides no direct method to obtain the window handle associated with a console application. However, you can obtain the window handle by calling findwindow. This function retrieves the window handle based on the class name or window name.
Call to determine the current
expression and outputs the appropriate information to the console only if the expression is FalseBack to top of Console.count(This method is very practical OH) when you want to count the number of times the code is executedBack to top of Console.dir(This method is I often use can not know how much more convenient than for in) directly to the DOM node in the structure of the DOM tree output, you can detail the method of object development and so onBac
httprequestmessage (httpmethod. Get, "http: // localhost/Foo/Bar ")));Batchcontent. Add (New httpmessagecontent (New httprequestmessage (httpmethod. Get, "http: // localhost/API/values/1 ")));
In a console application, we can log both the request and response with code like this:In a console applicationProgram, We can use the followingCodeLogs for requests and
The basics of console programming include the following five articles:
Console Basic Concepts
Console Foundation Concept Examples
console input and output mechanism
console input and output mechanism example
Cons
Docker provides the following four types of Api:docker Registry API Docker Hub API Docker API Docker Remote API for ease of use
This article is designed to explore the Docker Registry API, the Docker Hub API, and the OAuth
waiting for the operation to complete. The previous tutorial (calling a Web API from a Console application) showed only blocking calls:HttpClient is designed to be non-blocking. Potentially, long-running operations are implemented as asynchronous methods, such asGetasync and postasync. These methods do not wait for the operation to complete before they are returned. The previous tutorial (calling the Web
Console.assertAsserts the input expression and outputs the appropriate information to the console only if the expression is FalseBack to top of Console.count(This method is very practical OH) when you want to count the number of times the code is executedBack to top of Console.dir(This method is I often use can not know how much more convenient than for in) directly to the DOM node in the structure of the DOM tree output, you can detail the method of
[])
{
Messagebox (null, hello, notice, mb_ OK );
Return 0;
}
When the linker sees the windows option in/subsystem by default, it will automatically find winmain or wwinmainHowever, you must specify the entry address to hide the default console window when running the program!The above is set using the # pragma command in the code, and one is directly in the development environment
Manually changed project-> setting-> link-> project option!
After writ
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.