Created
March 17, 2025 10:52
-
-
Save sunghyuck-cpf21b/8f064a0340b34e994926114cff4090eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 양성혁 | |
| import java.io.BufferedWriter; | |
| import java.io.File; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| public class Main { | |
| public static void main(String[] args) { | |
| try { | |
| File file = new File("index.html"); | |
| BufferedWriter writer = new BufferedWriter((new FileWriter(file))); | |
| String index = "<head>\n" + | |
| " <title>index</title>\n" + | |
| " <meta charset=\"UTF-8\" />\n" + | |
| " <style>\n" + | |
| " table { border-collapse: collapse; width: 100%; }\n" + | |
| " th, td { border: solid 1px #000; }\n" + | |
| " </style>\n" + | |
| "</head>\n" + | |
| "<body>\n" + | |
| " <table>\n" + | |
| " <tr>\n" + | |
| " <th>키</th>\n" + | |
| " <th>값</th>\n" + | |
| " </tr>\n"; | |
| for (Object k : System.getProperties().keySet()) { | |
| String key = k.toString(); | |
| String value = System.getProperty(key); | |
| String result = " <tr>\n" + | |
| " <td>" + key + "</td>\n" + | |
| " <td>" + value + "</td>\n" + | |
| " </tr>\n"; | |
| index += result; | |
| } | |
| index += " </table>\n</body>"; | |
| writer.write(index); | |
| writer.close(); | |
| } catch (IOException e) { | |
| e.printStackTrace(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment