double 1.0 format为1.00怎么实现?注意是double类型,不是string类型

zhangzhenyuzy 2017-05-03 08:03:59
今天调用一个接口,需要传入一个double类型的数值.这个接口是画图的,传入的double类型值会显示在图表上.
但是,业务偏偏需要所有的数值都是2位小数,就是说2.00这样.
请问怎么把1或者2或者2.0这样的有理数显示为2.00 1.00这样.
请问怎么把1.0这样的double类型转为1.00呢?
谢谢大家!
...全文
742 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
BlazingAngle 2017-10-12
  • 打赏
  • 举报
回复
一楼的是new、一个格式化器吗、》 ?
zhangzhenyuzy 2017-10-11
  • 打赏
  • 举报
回复
引用 2 楼 bobolnear 的回复:
Double d = 1.00;
		DecimalFormat    df   = new DecimalFormat("######0.00");   
		Double dd = Double.parseDouble(df.format(d));
		System.out.println(df.format(dd));
你好,你这样是string类型.double数据类型就是不支持.00这样的数据结构的.业务给领导骂了个狗血淋头.大快人心
zhangzhenyuzy 2017-10-11
  • 打赏
  • 举报
回复
大家好,业务取消了这个外行的要求.
bobolnear 2017-05-04
  • 打赏
  • 举报
回复
Double d = 1.00;
		DecimalFormat    df   = new DecimalFormat("######0.00");   
		Double dd = Double.parseDouble(df.format(d));
		System.out.println(df.format(dd));
天涯共明月 2017-05-04
  • 打赏
  • 举报
回复
请查看 http://glblong.blog.51cto.com/3058613/1312340 其中的:
//方案二:
DecimalFormat df = new DecimalFormat("#.##");
get_double = Double.ParseDouble(df.format(result_value));
//方案三:
get_double = Double.ParseDouble(String.format("%.2f",result_value));
OutlookAttachView v2.73 Copyright (c) 2009 - 2014 Nir Sofer Web site: http://www.nirsoft.net Related Utilities ================= * NK2Edit - Edit, merge and fix the AutoComplete files (.NK2) of Microsoft Outlook. Description =========== OutlookAttachView scans all messages stored in your Outlook, and displays the list of all attached files that it finds. You can easily select one or more attachments and save all of them into the desired folder, as well as you can delete unwanted large attachments that take too much disk space in your mailbox. You can also save the list of attachments into xml/html/text/csv file. System Requirements =================== * Windows 2000/XP/Vista/7/8/2003/2008. * Microsoft Outlook 2003, Microsoft Outlook 2007, Microsoft Outlook 2010, or Microsoft Outlook 2013. For the 64-bit version of Outlook 2010/2013, you should use the x64 version of OutlookAttachView. Be aware that OutlookAttachView doesn't work with Outlook Express. Versions History ================ * Version 2.73 o OutlookAttachView now also scans the root folder of the .pst file. * Version 2.72 o Added %from_email% and %to_email% variables to the attachment filename format. * Version 2.71 o Added %localmsgtime% and %localmsgdate% variables to the attachment filename format. o Fixed a crash problem occurred on some systems after version 2.70 update. * Version 2.70 o Fixed to display date/time values according to daylight saving time settings. * Version 2.69 o Fixed bug: OutlookAttachView crashed on some systems. * Version 2.68 o Added secondary sorting support: You can now get a secondary sorting, by holding down the shift key while clicking the column header. Be aware that you only have to hold down the shift key when clicking the second/third/fourth column. To sort the first column you should not hold down the Shift key. * Version 2.67 o Fixed bug: when turning on the 'Image Preview' option, OutlookAttachView displayed empty image or incorrect image. * Version 2.66 o Added more accelerator keys (in the menus). * Version 2.65 o Added 'Image Preview' option (Under the View menu). If you turn on this option, a preview of selected gif/png/jpg file will be displayed in the lower pane. Be aware that this feature is quite slow... * Version 2.63 o The number of attachments is now displayed in the status bar while scanning the mailbox of Outlook. * Version 2.62 o Added 'Recent Config Files' menu, which allows you to easily open the last 10 configuration files that you used. * Version 2.61 o Added GB and Automatic to the 'File Size Unit' option. * Version 2.60 o Added option to save and load the entire configuration of OutlookAttachView ('Save Configuration' and 'Load Configuration' under the File menu). * Version 2.56 o OutlookAttachView now remembers the last size and position of the 'Copy Selected Files To...' window. * Version 2.55 o You can now specify wildcards (For example: nir*.doc, abc???.txt) in the include/exclude filename option. * Version 2.51 o Added option to choose the file size display unit: Bytes, KB, or MB. * Version 2.50 o OutlookAttachView now remembers that last 20 strings you typed in the Extensions List, Excluded Extensions List, Subject contains string..., From string, and To string, and you can easily select a string again from a Combo-Box. * Version 2.47 o Added option to choose another font (font name and size) to display the attachments list. (Options -> Select Another Font) * Version 2.46 o Fixed the flickering occurred while scrolling the attachments list. * Version 2.45 o You can now resize the scan options dialog-box. Also, the last size and position of this dialog-box is saved to the config file. * Version 2.43 o Added %attach_id% variable to the attachment filename format. * Version 2.42 o Added option to change the maximum number of characters in every variable of formatted filename. (The default is 64 characters) * Version 2.41 o Added option to filter by the message direction (incoming or outgoing) in the Scan Options window. * Version 2.40 o Added %message_direction% and %message_entryid% variables to the attachment filename format. * Version 2.38 o The 'Show Inline Attachments' option is now turned on by default (In previous versions it was turned off). The reason for this changed: I found out that many users think that there is a bug in OutlookAttachView because they can't find some of the attachments, without understanding that they have to turn on the 'Show Inline Attachments' option. * Version 2.37 o Fixed issue: The properties and the options windows opened in the wrong monitor, on multi-monitors system. * Version 2.36 o Added 'Auto Size Columns+Headers' option, which allows you to automatically resize the columns according to the row values and column headers. * Version 2.35 o Added 'Message EntryID' column, which displays the ID string of the Outlook message. * Version 2.32 o Added %domain% variable to the attachment filename format. * Version 2.31 o Added /SaveDirect command line option, for using with the other save command-line options (/scomma, /stab, /sxml, and so on...) When you use the SaveDirect mode, the attachments list is saved directly to the disk, without loading them into the memory first. This means that you can save a list with large amount of attachment lines into your disk without any memory problem, as long as you have enough disk space to store the saved file. The drawback of this mode: You cannot sort the attachments according to the column you choose with /sort command-line option. * Version 2.30 o Added 'Domain' column, which displays the domain of the from/to email address. * Version 2.25 o Added 'Message Direction' column (Incoming or Outgoing). * Version 2.20 o Added 'From Email' and 'To Email' columns, which displays the From/To email addresses. (The existing To/From columns shows the 'Display Name') * Version 2.15 o Added 'Put Icon On Tray' option. * Version 2.11 o When trying to connect to Outlook 2010 with the wrong build of OutlookAttachView (OutlookAttachView 32-bit with Outlook x64 or OutlookAttachView x64 with Outlook 32-bit), OutlookAttachView now displays informative error message about the problem. * Version 2.10 o Changed the user interface of the Main Scan Options window, to make it useable for lower screen resolutions and to give more space to the folders/subjects/from/to include/exclude lists. * Version 2.05 o Added 'Skip Exchange public folders' option. * Version 2.00 o Added command-line options to change any configuration value. * Version 1.95 o Added /extractall command-line option, which allows you to extract all Outlook attachments from command-line, according to your saved settings. * Version 1.90 o Added option to scan only emails in the last xx days (alternative to the date/time range). * Version 1.85 o Added option to scan only emails with the specified 'From' and 'To' strings. * Version 1.82 o When adding a folder to scan (with the Add button), the folder path in now delimited with quotes, to ensure that it'll be scanned properly if the folder name contains a comma character. * Version 1.81 o Fixed a crash problem when trying to save outlook attachment. * Version 1.80 o Added 'Add' buttons, which allows you to easily add folders to scan or skip by choosing them from the list of Outlook folders. * Version 1.75 o Added the ability to choose the desired Outlook profile inside the 'Mailbox Scan Options' window. * Version 1.72 o You can now specify a folder with all its subfolders (to include or to skip) by adding * character to the folder string, for example: Personal Folders\Inbox* * Version 1.71 o Fixed OutlookAttachView to be able to scan the public folders of Exchange server. * Version 1.70 o Added option to specify a custom date/time format for the filename in the 'Copy Selected Files To...' option, for example: %msgdate:yyyyMMdd% , %msgtime:HHmmss% * Version 1.67 o OutlookAttachView now displays (in the status bar) the current copied filename while copying the attachments. It also allows you to stop the copying process by clicking the stop menu. * Version 1.66 o In the 'Copy Selected Files To...' window, you can now specify a subfolder in the attach filename format. For example, if the filename format is %folder_name%\%subject%_%attach_name%.%extension% - All attachments from the inbox will be saved under the Inbox subfolder, All attachments from Sent Items will be saved under the Sent Items subfolder, and so on... o You can also choose the 'Create subfolders automatically' option if you want that OutlookAttachView will automatically create the subfolders for you. * Version 1.65 o Added time fields for the scanning date range. o The date range is now saved in the .cfg file. * Version 1.63 o Added 2 actions to 'Double-Click Action': 'Open Selected Attachment With' and 'Copy Selected Attachment To' * Version 1.62 o Fixed bug: OutlookAttachView crashed when trying to extract a special type of attachment. * Version 1.61 o Added 'Mark Inline Attachments' option. When it's turned on, inline attachments are marked with blue background color. * Version 1.60 o Added /start command-line option, which instructs OutlookAttachView to start the mailbox scan immediately with the loaded configuraion, without displaying the Scan Options dialog-box. o Decreased the memory consumption when the list of found attachments is very large. * Version 1.57 o Added new option to specify the list of folders that you wish to skip (comma-delimited list). * Version 1.56 o Added 'Mark Odd/Even Rows' option, under the View menu. When it's turned on, the odd and even rows are displayed in different color, to make it easier to read a single line. * Version 1.55 o Added new option to specify the list of folders that you wish to scan (comma-delimited list), instead of scanning the entire mailbox. * Version 1.51 o Added 'Open Selected Attachment With...' option, which allows you to quickly view the content of the attachment with another application, instead of the default one. * Version 1.50 o Added 'Open Selected Attachment' option (F7), which allows you to quickly view the content of the attachment, without the need to extract the file and then open it from Explorer. Be aware that when you use this option, OutlookAttachView extracts the attachment into a temporary folder, and then opens it with the default application, according to the file extension. When you close OutlookAttachView, all temporary attachment files are automatically deleted. o Added to option to choose what to do when you double-click on a single attachment: Open Properties Window, Open Outlook Message, or Open Attachment File. * Version 1.47 o The status bar now displays the total size of selected attachments in KB/MB. * Version 1.46 o You can now send the attachments list to stdout by specifying an empty filename ("") in the command-line. (For example: OutlookAttachView.exe /stab "" > c:\temp\att.txt) * Version 1.45 o Add new filter: Scan only emails that their subject contains the specified string. * Version 1.41 o Added option to exclude one or more file extensions from the attachments list (in comma-delimited list). * Version 1.40 o Added Extension column, so now you can easily sort the list by the file extension of the attachments. o Added option to filter the attachments list by file extension - you can now specify the list of file extensions (in comma-delimited list) that you want to find. All attachments with file extensions that are not in the list won't be displayed. * Version 1.37 o Added /cfg command-line option for loading the configuration from another .cfg file. * Version 1.36 o Added %message_size% and %folder_path% (full folder path) variables to the attachment filename format. * Version 1.35 o Added an option to control the filename format for extracting the attachments. (In the 'Copy Selected Files To...' window) You can include the following fields in the created filename: Subject, From, To, Attachment Name, Folder Name, Message Date, and Message Time. o Added 'Set the modified time of the file to the time of the message' option. When it's turned on, the extracted attachment file will get the same modified time of the message that contains the attachment. * Version 1.30 o Added 'Email Software' column, which displays the email software that was used to send the message. The value is taken from x-mailer header line. This column is only relevant for received messages (Inbox). o Added 'Computer Address' column, which displays the computer name or IP addresses that sent the message. This column is only relevant for received messages (Inbox). * Version 1.25 o Added a new option to 'Mailbox Scan Options', which allows you to scan another profile of Outlook, instead of the default one. o Added 'Add Header Line To CSV/Tab-Delimited File' option. When this option is turned on, the column names are added as the first line when you export to csv or tab-delimited file. * Version 1.21 o Added support for embedded message attachments (attachments of another message). These attachments are saved as .msg files. * Version 1.20 o Added option to filter by attachment size. o Fixed issue: removed the wrong encoding from the xml string, which caused problems to some xml viewers. * Version 1.15 o Added 'MailBox Scan Options' window, which allows you to choose the dates range to scan. o Fixed bug: The 'Created On' column displayed wrong dates in some Outlook configurations. * Version 1.13 o Added 'Copy Selected Attachments To...' into the right-click context menu. Also, changed the 'Save Selected Items' to 'Export Attachments Information', to avoid the confusion between saving the attachment files and exporting the attachments details. o Added separated x64 version - for using only with x64 version of Outlook 2010. * Version 1.12 o Fixed a crash problem when using this utility with IMAP accounts. * Version 1.11 o Added sorting command-line options. * Version 1.10 o Added 'Open Message In Outlook' option. * Version 1.06 o Added 'Clean Selected Attachments' option - clean the content of attachment, but without removing the attachment entry. * Version 1.05 o Fixed bug: OutlookAttachView failed to scan sub-folders under main Outlook folders. o Added 'Folder Path' column. * Version 1.00 - First release. Using OutlookAttachView ======================= OutlookAttachView doesn't require any installation process or additional dll files. In order to start using it, simply run the executable file - OutlookAttachView.exe If you have only one profile in your Outlook, and this profile doesn't require any password, you can run OutlookAttachView even without starting Outlook, and it'll automatically scan the mailbox of your current Outlook profile. Otherwise, it's recommended to open Outlook in the right profile before starting OutlookAttachView. After running OutlookAttachView, the 'MailBox Scan Options' window will be displayed. This window allows to choose to scan your mailbox only in specific dates range. After choosing 'Ok' in the options window, OutlookAttachView starts to scan your Outlook messages and display the found attachments in the main window of OutlookAttachView. If you want to stop the scan process, simply choose the 'Stop' menu. After the scanning process is finished, you can select one or more of your attached files, and copy them into the desired folder, by using the 'Copy Selected Files To' option. If have large attachments that you want to delete, you can use the 'Delete Selected Attachments' option. Be aware that when you use the delete option, only the attachment file is deleted. The message itself remains on your mailbox. You can also use the 'Clean Selected Attachments' option to clean most of the attachment content, but without removing the attachment entry. If you use this option, you'll still see the attachment listed in your email message with small file size, but saving this attachment to a file will create a corrupted file. Inline Attachments ================== Attachments embedded as a part of the message body are detected as 'Inline Attachments'. By default, OutlookAttachView doesn't displays these inline attachments. If you can't find the attachments you're looking for, you should try to turn on the 'Show Inline Attachments' option, located under the Options menu. Control The Filename Format of Extracted Attachment =================================================== When you extract one or more attachments from your Outlook mailbox, you can control the way that the attach filename is generated. By default, OutlookAttachView use the following format: %attach_name%.%extension%, which means that the generated filename will only contain the original attachment name and the file extension. However, you can also use the following special variables to format the filename according to your needs: * %attach_name% - The original name of the attachment. * %extension% - The original file extension of the attachment. * %subject% - The subject of the email contains this attachment. * %folder_name% - The folder name of this email (Inbox, Sent Items, and so on) * %from% - The sender of the email. * %to% - The 'To' field of the email. * %message_date% - Message creation date in yyyymmdd format. * %message_time% - Message creation time in HHmmss format. * %message_size% - Attachment size, in bytes. * %folder_path% - Full folder path of this email. (For example: Personal Folder-Inbox) * %msgdate:[format]% - Message creation date (GMT), in any format you need, for example: %msgdate:yyyyMMdd% , %msgdate:ddMMyy% * %msgtime:[format]% - Message creation time (GMT), in any format you need, for example: %msgtime:HHmmss% * %localmsgdate:[format]% - Message creation date (local time), in any format you need, for example: %localmsgdate:yyyyMMdd% , %localmsgdate:ddMMyy% * %localmsgtime:[format]% - Message creation time (local time), in any format you need, for example: %localmsgtime:HHmmss% For example: If you want to generate the attachment filename with the subject, folder name, and attach name: %folder_name%_%subject%_%attach_name%.%extension% Be aware that some of the values are automatically truncated after 64 characters, in order to avoid from over-sized filenames. Scanning Outlook Attachments of External PST Files ================================================== If you want to search an attachment in one or more PST files that are not loaded in your Outlook profile, you can use the following trick: 1. Go to Control Panel -> Mail and choose 'Show Profiles' 2. Click 'Add' to create a new profile. 3. Fill the email account information with faked details (You can delete it afterwards) 4. After the profile is created, double click on the profile, and in the profile properties, click 'Data Files' and add the desired PST files that you wish to scan. 5. Also, you can click the 'E-mail Accounts' button, and remove the faked account that you previously created. 6. In the Mailbox Scan Options of OutlookAttachView, choose 'Allow me to choose the profile' in the Outlook Profile option. 7. When you are asked to choose the profile, you should choose the profile that you created, and OutlookAttachView will scan the PST files that you added into it. Command-Line Options ==================== /stext Save the list of all Outlook attachments into a regular text file. /stab Save the list of all Outlook attachments into a tab-delimited text file. /scomma Save the list of all Outlook attachments into a comma-delimited text file. /stabular Save the list of all Outlook attachments into a tabular text file. /shtml Save the list of all Outlook attachments into HTML file (Horizontal). /sverhtml Save the list of all Outlook attachments into HTML file (Vertical). /sxml Save the list of all Outlook attachments to XML file. /SaveDirect Save the Outlook attachments in SaveDirect mode. For using with the other save command-line options ( /scomma, /stab, /sxml, and so on...) When you use the SaveDirect mode, the attachments list is saved directly to the disk, without loading them into the memory first. This means that you can save a list with large amount of attachment lines into your disk without any memory problem, as long as you have enough disk space to store the saved file. The drawback of this mode: You cannot sort the attachments according to the column you choose with /sort command-line option. /sort This command-line option can be used with other save options for sorting by the desired column. If you don't specify this option, the list is sorted according to the last sort that you made from the user interface. The parameter can specify the column index (0 for the first column, 1 for the second column, and so on) or the name of the column, like "Filename" and "Subject". You can specify the '~' prefix character (e.g: "~Subject") if you want to sort in descending order. You can put multiple /sort in the command-line if you want to sort by multiple columns. Examples: OutlookAttachView.exe /shtml "f:\temp\attach.html" /sort 2 /sort ~1 OutlookAttachView.exe /shtml "f:\temp\attach.html" /sort "From" /sort "To" /sort "Subject" /nosort When you specify this command-line option, the list will be saved without any sorting. /cfg Starts OutlookAttachView with the specified configuration file instead of the default OutlookAttachView.cfg /start Starts the mailbox scan immediately with the loaded configuraion, without displaying the Scan Options dialog-box. /extractall Extracts all Outlook attachments from command-line, according to your last settings saved in the default .cfg file, or according to other configuration file that you load with /cfg command-line option. You can also use the following command-line options to change any configuarion value you wish: /CopyFilesFolder /NewNameIfExist /UpdateModifiedTimeMessage /FilenameFormat /ScanOptions.TimeZone /ScanOptions.OutlookProfile /ScanOptions.UseExtensionsList /ScanOptions.ExtensionsList /ScanOptions.UseExcludeExtensionsList /ScanOptions.ExcludeExtensionsList /ScanOptions.UseSubjectContains /ScanOptions.SubjectContains /ScanOptions.ScanOnlyFolders /ScanOptions.ScanFoldersList /ScanOptions.SkipFolders /ScanOptions.SkipFoldersList /ScanOptions.DateFrom /ScanOptions.DateTo /ScanOptions.UseDateRange /ScanOptions.OutlookProfileString /ScanOptions.UseFromList /ScanOptions.FromList /ScanOptions.UseToList /ScanOptions.ToList /ScanOptions.UseOnlyLastDays /ScanOptions.OnlyLastDays For example, if you want to extract all attachments into c:\myattach instead of using the folder specified in the config file: OutlookAttachView.exe /CopyFilesFolder "c:\myattach" /extractall Translating OutlookAttachView to other languages ================================================ In order to translate OutlookAttachView to other language, follow the instructions below: 1. Run OutlookAttachView with /savelangfile parameter: OutlookAttachView.exe /savelangfile A file named OutlookAttachView_lng.ini will be created in the folder of OutlookAttachView utility. 2. Open the created language file in Notepad or in any other text editor. 3. Translate all string entries to the desired language. Optionally, you can also add your name and/or a link to your Web site. (TranslatorName and TranslatorURL values) If you add this information, it'll be used in the 'About' window. 4. After you finish the translation, Run OutlookAttachView, and all translated strings will be loaded from the language file. If you want to run OutlookAttachView without the translation, simply rename the language file, or move it to another folder. License ======= This utility is released as freeware. You are allowed to freely distribute this utility via floppy disk, CD-ROM, Internet, or in any other way, as long as you don't charge anything for this. If you distribute this utility, you must include all files in the distribution package, without any modification ! Disclaimer ========== The software is provided "AS IS" without any warranty, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. Feedback ======== If you have any problem, suggestion, comment, or you found a bug in my utility, you can send a message to nirsofer@yahoo.com
C----------------------------------------------------------------------- program runocc C----------------------------------------------------------------------- c C OCCAM 2.0: Steven Constable IGPP/SIO La Jolla CA 92093-0225 c Program Revision 2.01, 13 Jan 1993 c c runocc is the calling program for OCCAM v2.0. C C REFERENCES: CONSTABLE, PARKER & CONSTABLE, 1987: GEOPHYSICS 52, 289-300. C DEGROOT-HEDLIN & CONSTABLE, 1990: GEOPHYSICS 55, 1613-1624. C CONSTABLE, 1991: GEOPHYS. J. INT. 106, 387-388. C CONSTABLE, 1992: OCCAM DISTRIBUTION NOTES. C C REVISION HISTORY: C MARCH 1986, (VERSION 1.2) C OCTOBER 1987, (VERSION 1.3) C AUGUST 1988, (VERSION 1.4) C JANUARY 1989 (WITH THANKS TO C.DEGROOT-HEDLIN), (VERSION 1.5) C SEPTEMBER 1989, (VERSION 1.5.2) C APRIL 1992 (MORE THANKS TO CATHERINE AND ALSO WSE) (VERSION 2.0) C C IF YOU OBTAIN THIS CODE FROM A THIRD PERSON, PLEASE SEND YOUR NAME AND ADDRESS C TO S. CONSTABLE. YOU WILL THEN RECEIVE UPDATES, NEWS ON BUGS, ETC. C C VERSION 2.0 IS A RE-WRITE TO MAKE OCCAM INDEPENDENT OF THE DIMENSIONALITY C OF THE FORWARD PROBLEM, AND TO MAKE MAXIMUM USE OF DYNAMIC MEMORY ALLOCATION, C AS THE ARRAY SIZES FOR THE 2D PROBLEM ARE NOW GETTING TOO LARGE FOR COMFORT. C INCLUDE FILES ARE NOW USED TO STREAMLINE CHANGES OF DIMENSION. C IMPLICIT DOUBLE PRECISION HAS BEEN REMOVED, AGAIN FOR STORAGE REASONS. C CALLING PROGRAM IS NOW AN INTEGRAL PART OF THE PACKAGE AS ALL THE MODEL- C DEPENDENT STUFF HAS BEEN SPUN OFF. C C IF YOU OBTAIN THIS CODE FROM A THIRD PERSON, PLEASE SEND YOUR NAME AND ADDRESS C TO S. CONSTABLE. YOU WILL THEN RECEIVE UPDATES, NEWS ON BUGS, ETC. C C SUBROUTINES WHICH MUST BE SUPPLIED BY THE USER: C C FORMOD(NP,ND,PM,DP,DM), COMPUTES THE FORWARD FUNCTION FOR MODEL PM() AT C THE DATA PARAMETERS DP() AN
RX Library 2.75 with Delphi 2009 support (by FlexGraphics software) ====================================================================== The Set of Native Delphi Components for Borland Delphi versions 1, 2, 3, 4, 5, 6, 7, 2005, 2006, 2009 and Borland C++ Builder 1, 3, 4, 5, 6, 2006 & 2009. 100% Source Code. Last revision date Oct 12, 1999. PLEASE FOLLOW THE INSTRUCTIONS PROVIDED IN THE INSTALLATION SECTION! TABLE OF CONTENTS ----------------- Latest Changes Overview History License Agreement Installation Demonstration Programs Source Files Using GIF Images Copyright Notes NEW FOR VERSION 2.75 -------------------- Delphi 5.0 & C++Builder 4.0 Compatibility New components: TRxLoginDialog New properties, events: TFormPlacement.RegistryRoot TFormPlacement.Version TFontComboBox.UseFonts TRxDBGrid.OnTopLeftChanged TRxDBLookupCombo.DisplayValues TStrHolder.Macros, TStrHolder.OnExpandMacros RxSpin.TValueType.vtHex New routines, methods, constants: SaveClipboardToStream, LoadClipboardFromStream (clipmon.pas) AppFileName, AppVerInfo (rxverinf.pas) XorString, XorEncode, XorDecode (strutils.pas) BUG FIXES. Overview -------- This version is the result of long unactivity of RX Library authors and some imperfections and bugs of other RX adaptations to Delphi 6. The authors of this version disclaim all warranties as to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Use under your own responsibility, but comments (even critique) in English (or in Russian) are welcome. RX Library contains a large number of components, objects and routines for Borland Delphi with full source code. This library is compatible with Borland Delphi 1, 2, 3, 4, 5, 6 and Borland C++ Builder 1, 3, 4. This collection includes over 60 native Delphi components. RX Library is a freeware product. Feel free to distribute the library as long as all files are unmodified and kep
CurrPorts v2.10 Copyright (c) 2004 - 2013 Nir Sofer Web site: http://www.nirsoft.net Description =========== CurrPorts displays the list of all currently opened TCP/IP and UDP ports on your local computer. For each port in the list, information about the process that opened the port is also displayed, including the process name, full path of the process, version information of the process (product name, file description, and so on), the time that the process was created, and the user that created it. In addition, CurrPorts allows you to close unwanted TCP connections, kill the process that opened the ports, and save the TCP/UDP ports information to HTML file , XML file, or to tab-delimited text file. CurrPorts also automatically mark with pink color suspicious TCP/UDP ports owned by unidentified applications (Applications without version information and icons) Versions History ================ * Version 2.10: o When saving the opened ports from command-line, CurrPorts now uses the same columns order saved in the .cfg file. * Version 2.09: o Fixed bug from version 2.08: Some filters stopped working... * Version 2.08: o Added support for filtering by process ID (In Advanced Filters window), for example: include:process:327 * Version 2.07: o Fixed the flickering on automatic refresh. * Version 2.06: o Fixed issue: The properties dialog-box and other windows opened in the wrong monitor, on multi-monitors system. * Version 2.05: o Added support for GeoLite City database. You can now download the GeoLite City database (GeoLiteCity.dat.gz), put it in the same folder of cports.exe, and CurrPorts will automatically use it to get the country/city information for every remote IP address. * Version 2.02: o CurrPorts now displays a simple error message if it fails to close one or more TCP connections. * Version 2.01: o The 'Remote Address' and 'Local Address' columns are now sorted by the IP address numerically. (In previous versions they were sorted alphabetically) * Version 2.00: o Added optional fifth parameter to the /close command-line option, which allows you to specify a process name (e.g: firefox.exe) * Version 1.97: o The 'Use DNS Cache For Host Names' option is now turned off by default, because it seems that reading the DNS cache causes a memory leak on some Windows 7/x64 systems. * Version 1.96: o Fixed bug: CurrPorts randomly failed to display remote port numbers of IPv6 connections. * Version 1.95: o Added 'Use DNS Cache For Host Names' option. When it's turned on, CurrPorts uses the DNS cache of Windows to resolve remote IP addresses. * Version 1.94: o Added 'Custom' AutoRefresh option under Options -> Auto Refresh. The number of seconds for the Custom AutoRefresh can be set in the Advanced Options window (Ctrl+O) o Fixed the problem with sending the data to stdout (when the filename is empty string). * Version 1.93: o Updated the internal country names (added more 14 countries) that are used for displaying the country name in the 'Remote IP Country' column. * Version 1.92: o When choosing 'Clear Log File' option, CurrPorts now asks you whether you want to clear the log, in order to avoid from clearing the log file by mistake. * Version 1.91: o Added 'Beep On New Ports' option. * Version 1.90: o Added 'Tray Balloon On New Ports' option. When both this option and 'Put Icon On Tray' option are turned on, every new port detected by CurrPorts will be displayed in a tray balloon. (If the TCP/UDP port is filtered by the other CurrPorts options and it's not displayed in the main window, it won't be displayed in the tray balloon.) * Version 1.87: o Improved the 'User Name' column. If you run CurrPorts as administrator, this column will display the user name for all processes. (In previous versions, CurrPorts failed to detect processes created by other users, even when you run it as Administrator) * Version 1.86: o Added 'Mark Odd/Even Rows' option, under the View menu. When it's turned on, the odd and even rows are displayed in different color, to make it easier to read a single line. * Version 1.85: o Added command-line options to control the settings under the Options and View menus: /MarkPorts, /DisplayUdpPorts, /DisplayTcpPorts, /DisplayClosedPorts, and more... * Version 1.83: o Added 'Add Header Line To CSV/Tab-Delimited File' option. When this option is turned on, the column names are added as the first line when you export to csv or tab-delimited file. * Version 1.82: o Added 'Resize Columns On Every Refresh' option, which allows you to automatically resize the columns according to the text length on every refresh. * Version 1.81: o Added more include/exclude filter options in the context menu of CurrPorts. * Version 1.80: o Added custom log line option (In 'Advanced Options' window), which allows you to set the format of the log line and put in it any column value you like. * Version 1.76: o Added 'One-Click Tray Icon' option. When it's checked and you use the tray icon option, one click on the tray icon with the left mouse button will open CurrPorts. (Without this option, double-click is required) * Version 1.75: o Added 'Exclude Selected Processes In Filters' option in the context menu. o Added accelerator key for 'Include Selected Processes In Filters' option. o Fixed bug 'Include Selected Processes In Filters' option: failed to work on system process. o Added 'Disable All Filters' option to easily toggle between active filter state and no filter state, as an alternative for 'Clear All Filters', which doesn't allow you to return back the filters. * Version 1.70: o Added /sort command-line option for sorting the connections list saved from command-line. * Version 1.66: o Fixed issue: When CurrPorts window is hidden and there is an icon in the taskbar, running CurrPorts again will open the existing instance of CurrPorts, instead of creating another one. * Version 1.65: o Added drag And drop icon in the toolbar that allows to to easily filter by the desired application. Simply drag the target icon into the window of the application, and CurrPorts will display only the opened ports of this application. * Version 1.60: o Added new column: Window Title (The window title of the process) o Added 'Clear All Filters' option. o Added 'Include Selected Processes In Filters' option. Allows you to easily filter by selected processes. * Version 1.56: o Added new option: Ask before any action. (If you uncheck this option, CurrPorts won't ask you any question before closing ports/applications) * Version 1.55: o Added number of remote connections to the status bar. o Added ports information in the tray icon tooltip. * Version 1.51: o Fixed bug: In rare cases, exception window may appear when starting CurrPorts. * Version 1.50: o Added 'Display Port In Address' option. When this option is checked, the addresses will be displayed in 'address:port' format. * Version 1.48: o Fixed the Alt+1 accelerator key. * Version 1.47: o Added AutoRefresh every 1 second. * Version 1.46: o Automatically launch IPNetInfo when it's in the same folder of CurrPorts. * Version 1.45: o Added 'Remote IP Country' column that displays the country name of the remote IP address (requires to download an external file from here) * Version 1.41: o Fixed bug: CurrPorts failed to display the current Auto Refresh status in Menu. * Version 1.40: o Added support for IPv6. * Version 1.37: o Fixed bug: CurrPorts failed to display process information when running under Windows Vista with non-admin user. o Added Module Filename column (works only on XP/SP2) * Version 1.36: o Fixed bug: The main window lost the focus when the user switched to another application and then returned back to CurrPorts. * Version 1.35: o Fixed bug in saving as comma-delimited file when field values contained comma character. * Version 1.34: o New Option: Remember Last Filter (The filter is saved in cports_filter.txt) * Version 1.33: o Added support for saving comma-delimited (.csv) files. o Added new command-line option: /scomma * Version 1.32: o New Option: Start CurrPorts As Hidden (Only when 'Put Icon On Tray' is turned on) o New Option: Copy Remote IP Address (F2). * Version 1.31: o Fixed bug: TCP and UDP ports with the same number and in the same process merged into one item. * Version 1.30: o New column: Added On - Displays the date that the specified connection was added. o New Option: Put Icon On Tray. o New Option: Log File. * Version 1.20: o Added support for filters. o The settings of CurrPorts utility is now saved to cfg file instead of using the Registry. o New command-line options. o You can now send the information to stdout by specifying an empty filename ("") in the command-line. o Added support for x64. * Version 1.11: o Added support for process information in Vista. * Version 1.10: o A tooltip is displayed when a string in a column is longer than the column length. * Version 1.09: o /close command-line parameter - Close a connection from command-line * Version 1.08: o Fixed columns order bug. * Version 1.07: o New option: Resolve the remote IP addresses. * Version 1.06: o New column: Process Attributes - Display the file attributes of the process (H for hidden, R for read-only, and so on) o Added support for working with IPNetInfo utility * Version 1.05: o Fixed bug: identify process path starting with '\??\' * Version 1.04: o Added more accelerator keys. o Added support for Windows XP visual styles. * Version 1.03: o New Option: Display Listening o New Option: Display Established o New Option: Display Items With Unknown State o New Option: Display Items Without Remote Address * Version 1.02: o Fixed bug: "Exception C0000005" message when running CurrPorts on Windows NT/2000 without administrator rights. o New column: "Process Services" - Displays the list of services of a process. * Version 1.01: o The 'Copy Selected Items' option now copies the ports data in tab-delimited format, so you can instantly paste the data into your Excel worksheet. o Improvment in ports to process binding under Windows 2000. Process information is now also displayed under Windows NT. * Version 1.00: First release. System Requirements =================== This utility works perfectly under Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7. There is also a separated download of CurrPorts for x64 versions of Windows. If you want to use this utility on Windows NT, you should install psapi.dll in your system32 directory. You can also use this utility on older versions of Windows (Windows 98/ME), but in these versions of Windows, the process information for each port won't be displayed. Using CurrPorts =============== CurrPorts utility is a standalone executable, and it doesn't require any installation process or additional DLLs. In order to start using it, just copy the executable file (cports.exe) to any folder you like, and run it. The main window of CurrPorts displays the list of all currently opened TCP and UDP ports. You can select one or more items, and then close the selected connections, copy the ports information to the clipboard, or save it to HTML/XML/Text file. If you don't want to view all available columns, or you want to change the order of the columns on the screen and in the files you save, select 'Choose Column' from the View menu, and select the desired columns and their order. In order to sort the list by specific column, click on the header of the desired column. The Options Menu ================ The following options are available under the Options menu: * Display Listening: If this option is enabled, all listening ports are displayed. * Display Established: If this option is enabled, all established connections are displayed. * Display Closed: If this option is enabled, closed ports (with 'Time Wait', 'Close Wait', or 'Closed' state) are displayed. * Display Items With Unknown State: If this option is enabled, items with unknown state (the state column is empty) are displayed. * Display Items Without Remote Address: If this option is enabled, disconnected ports with no remote address are displayed. * Display TCP Ports: If this option is disabled, TCP ports won't be displayed in the ports list. * Display UDP Ports: If this option is disabled, UDP ports won't be displayed in the ports list. * Mark Ports Of Unidentified Applications: If this option is enabled, all TCP/UDP ports that opened by applications with no version information and with no icons, are automatically marked with pink color. If you have on your system one or more ports marked with pink color, you should deeply check the processes that created these ports. It could be only an innocent application that simply doesn't contain any icons and version information (For example: the executables of MySQL and Oracle servers don't contain any icons or version info, so if you have MySQL/Oracle servers on your system, the ports they open will be marked.) , but it can also be a trojan or other unwanted application that infiltrated into your system. * Mark New/Modified Ports: If this option is enabled, each time the ports list is refreshed, all newly added ports and existing ports with changes are marked with green color. * Auto Refresh: Allows you to automatically refresh the opened ports list each 2, 4, 6, 8, or 10 seconds. * Sort On Auto Refresh If this option is enabled, the entire ports list is sorted each time that the list is refreshed automatically. Otherwise, new/modified ports are added to the bottom of the list. The 'Remote IP Country' column ============================== In order to watch the countries of the remote IP addresses, you have to download the latest IP To Country file from here. You have the put the 'IpToCountry.csv' file in the same folder of cports.exe You can also use the GeoLite City database. Simply download the GeoLite City in Binary / gzip (GeoLiteCity.dat.gz) and put it in the same folder of cports.exe If you want to get faster loading process, extract the GeoLiteCity.dat from the GeoLiteCity.dat.gz and put it in the same folder of cports.exe Using Filters ============= Starting from version 1.20, you can monitor only the opened ports that you need, by using the "Advanced Filters" option (Options -> Advanced Filters). In the filters dialog-box, you can add one or more filter strings (separated by spaces, semicolon, or CRLF) in the following syntax: [include | exclude] : [local | remote | both | process] : [tcp | udp | tcpudp] : [IP Range | Ports Range] Here's some examples that demonstrate how to create a filter string: * Display only packets with remote tcp port 80 (Web sites): include:remote:tcp:80 * Display only packets with remote tcp port 80 (Web sites) and udp port 53 (DNS): include:remote:tcp:80 include:remote:udp:53 * Display only packets originated from the following IP address range: 192.168.0.1 192.168.0.100: include:remote:tcpudp:192.168.0.1-192.168.0.100 * Display only TCP and UDP packets that use the following port range: 53 - 139: include:both:tcpudp:53-139 * Filter most BitTorrent packets (port 6881): exclude:both:tcpupd:6881 * Display only the opened ports of FireFox browser: include:process:firefox.exe Integration with IPNetInfo utility ================================== If you want to get more information about the remote IP address displayed in CurrPorts utility, you can utilize the Integration with IPNetInfo utility in order to easily view the IP address information from WHOIS servers: 1. Download and run the latest version of IPNetInfo utility. (If you have IPNetInfo with version prior to v1.06, you must download the newer version.) 2. Select the desired connections, and then choose "IPNetInfo" from the File menu (or simply click Ctrl+I). 3. IPNetInfo will retrieve the information about remove IP addresses of the selected connections. Log File ======== Starting from version 1.30, CurrPorts allows you to save all changes (added and removed connections) into a log file. In order to start writing to the log file, check the 'Log Changes' option under the File menu. By default, the log file is saved as 'cports.log' in the same folder that cports.exe is located. You can change the default log filename by setting the 'LogFilename' entry in cports.cfg file. Be aware that the log file is updated only when you refresh the ports list manually, or when the 'Auto Refresh' option is turned on. Custom Log Line =============== Starting from version 1.80, you can set the format of the lines in the log file according to your needs. In order to use this feature, go to 'Advanced Options' window (Ctrl+O), check the custom log line option, type the desired format string. In the format string, you can use the following variables: %Process_Name% %Protocol% %Local_Port% %Local_Address% %Remote_Port% %Remote_Address% %Process_Path% %Process_ID% %State% %Product_Name% %File_Description% %File_Version% %Company% %Process_Created_On% %Local_Port_Name% %Remote_Port_Name% %User_Name% %Process_Services% %Process_Attributes% %Remote_Host_Name% %Added_On% %Module_Filename% %Remote_IP Country% %Window_Title% You can also set the minimum number of characters for the column value, for example: %Process_Name.25% (Fill with spaces - up to 25 characters) Notice: %Remote_Host_Name% variable is not displayed on newly added connections, because the IP address resolving is asynchronous operation, and the host name is still not available when the log line is added. Command-Line Options ==================== /stext Save the list of all opened TCP/UDP ports into a regular text file. /stab Save the list of all opened TCP/UDP ports into a tab-delimited text file. /scomma Save the list of all opened TCP/UDP ports into a comma-delimited text file. /stabular Save the list of all opened TCP/UDP ports into a tabular text file. /shtml Save the list of all opened TCP/UDP ports into HTML file (Horizontal). /sverhtml Save the list of all opened TCP/UDP ports into HTML file (Vertical). /sxml Save the list of all opened TCP/UDP ports to XML file. /sort This command-line option can be used with other save options for sorting by the desired column. If you don't specify this option, the list is sorted according to the last sort that you made from the user interface. The parameter can specify the column index (0 for the first column, 1 for the second column, and so on) or the name of the column, like "Remote Port" and "Remote Address". You can specify the '~' prefix character (e.g: "~Remote Address") if you want to sort in descending order. You can put multiple /sort in the command-line if you want to sort by multiple columns. Examples: cports.exe /shtml "f:\temp\1.html" /sort 2 /sort ~1 cports.exe /shtml "f:\temp\1.html" /sort "Protocol" /sort "~Remote Address" /nosort When you specify this command-line option, the list will be saved without any sorting. /filter string> Start CurrPorts with the specified filters. If you want to specify more than one filter, use the ';' character as a delimiter. /cfg Start CurrPorts with the specified config file. /MarkPorts /DisplayUdpPorts /DisplayTcpPorts /DisplayClosedPorts /MarkNewModifiedPorts /SortOnAutoRefresh /AlwaysOnTop /AskBefore /DisplayIPv6Ports /DisplayListening /DisplayEstablished /DisplayNoState /DisplayNoRemoteIP /ResolveAddresses /RememberLastFilter /DisplayPortInAddress /AutoRefresh, /ShowInfoTip /TrayIcon /TrayIconOneClick /StartAsHidden /LogChanges /LogFilename /DisabledFilters /AddExportHeaderLine You can use all these parameters to control the options that are available under the Options and View menus. For example, if you want to start CurrPorts with 'Display UDP Ports' turned off and 'Display Closed' turned on: cports.exe /DisplayUdpPorts 0 /DisplayClosedPorts 1 You can also use these parameters in conjunction with all save parameters. For example: If you want to save into tab-delimited file only the UDP ports: cports.exe /DisplayUdpPorts 1 /DisplayTcpPorts 0 /stab "c:\temp\udp.txt" Here's some examples: * Save all opened TCP/IP ports created by Internet Explorer browser to HTML file: cports.exe /filter "include:process:iexplore" /shtml "c:\temp\ports.html" * Add all opened ports information to ports.txt (as tab-delimited text file). This example only works when running it from a command-prompt window. cports.exe /stab "" >> c:\temp\cports1.txt * Start CurrPorts with filter that will only display the opened ports of Internet Explorer and FireFox: cports.exe /filter "include:process:firefox;include:process:iexplore" Closing a Connection From Command-Line ====================================== Starting from version 1.09, you can close one or more connections from command-line, by using /close parameter. The syntax of /close command: /close {Process Name} For each parameter, you can specify "*" in order to include all ports or addresses. The process name is an optional parameter. If you specify a process, only the ports of the specified process will be closed. Examples: * Close all connections with remote port 80 and remote address 192.168.1.10: /close * * 192.168.1.10 80 * Close all connections with remote port 80 (for all remote addresses): /close * * * 80 * Close all connections to remote address 192.168.20.30: /close * * 192.168.20.30 * * Close all connections with local port 80: /close * 80 * * * Close all connections of Firefox with remote port 80: /close * * * 80 firefox.exe Translating CurrPorts To Another Language ========================================= CurrPorts allows you to easily translate all menus, dialog-boxes, and other strings to other languages. In order to do that, follow the instructions below: 1. Run CurrPorts with /savelangfile parameter: cports.exe /savelangfile A file named cports_lng.ini will be created in the folder of CurrPorts utility. 2. Open the created language file in Notepad or in any other text editor. 3. Translate all menus, dialog-boxes, and string entries to the desired language. 4. After you finish the translation, Run CurrPorts, and all translated strings will be loaded from the language file. If you want to run CurrPorts without the translation, simply rename the language file, or move it to another folder. License ======= This utility is released as freeware. You are allowed to freely distribute this utility via floppy disk, CD-ROM, Internet, or in any other way, as long as you don't charge anything for this. If you distribute this utility, you must include all files in the distribution package, without any modification ! Disclaimer ========== The software is provided "AS IS" without any warranty, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. Feedback ======== If you have any problem, suggestion, comment, or you found a bug in my utility, you can send a message to nirsofer@yahoo.com

67,549

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧