diff options
Diffstat (limited to 'ThirdParty/CsvHelper-master/docs/examples/writing/index.html')
-rw-r--r-- | ThirdParty/CsvHelper-master/docs/examples/writing/index.html | 483 |
1 files changed, 483 insertions, 0 deletions
diff --git a/ThirdParty/CsvHelper-master/docs/examples/writing/index.html b/ThirdParty/CsvHelper-master/docs/examples/writing/index.html new file mode 100644 index 0000000..efe0007 --- /dev/null +++ b/ThirdParty/CsvHelper-master/docs/examples/writing/index.html @@ -0,0 +1,483 @@ +<!DOCTYPE html> +<html lang="en-us"> +<head> + <meta charSet="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <link rel="apple-touch-icon" sizes="57x57" href="/CsvHelper/favicons/apple-icon-57x57.png" /> + <link rel="apple-touch-icon" sizes="60x60" href="/CsvHelper/favicons/apple-icon-60x60.png" /> + <link rel="apple-touch-icon" sizes="72x72" href="/CsvHelper/favicons/apple-icon-72x72.png" /> + <link rel="apple-touch-icon" sizes="76x76" href="/CsvHelper/favicons/apple-icon-76x76.png" /> + <link rel="apple-touch-icon" sizes="114x114" href="/CsvHelper/favicons/apple-icon-114x114.png" /> + <link rel="apple-touch-icon" sizes="120x120" href="/CsvHelper/favicons/apple-icon-120x120.png" /> + <link rel="apple-touch-icon" sizes="144x144" href="/CsvHelper/favicons/apple-icon-144x144.png" /> + <link rel="apple-touch-icon" sizes="152x152" href="/CsvHelper/favicons/apple-icon-152x152.png" /> + <link rel="apple-touch-icon" sizes="180x180" href="/CsvHelper/favicons/apple-icon-180x180.png" /> + <link rel="icon" type="image/png" sizes="192x192" href="/CsvHelper/favicons/android-icon-192x192.png" /> + <link rel="icon" type="image/png" sizes="32x32" href="/CsvHelper/favicons/favicon-32x32.png" /> + <link rel="icon" type="image/png" sizes="96x96" href="/CsvHelper/favicons/favicon-96x96.png" /> + <link rel="icon" type="image/png" sizes="16x16" href="/CsvHelper/favicons/favicon-16x16.png" /> + <link rel="manifest" href="/CsvHelper/manifest.json" /> + <meta name="msapplication-TileColor" content="#ffffff" /> + <meta name="msapplication-TileImage" content="/ms-icon-144x144.png" /> + <meta name="theme-color" content="#ffffff" /> + <title>Writing | CsvHelper</title> + + + + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.1/css/bulma.min.css" /> + + <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css" /> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/vs.min.css" /> + <link rel="stylesheet" href="/CsvHelper/styles/index.css" /> + + <script defer src="https://use.fontawesome.com/releases/v5.14.0/js/all.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script> +</head> +<body> + <header id="header" class="header"> + <nav class="navbar is-light"> + <div class="navbar-brand"> + <a class="navbar-item" href="/CsvHelper"> + <img src="/CsvHelper/images/logo.svg" width="66" height="28" /> + </a> + <div id="navbar-burger" class="navbar-burger"> + <span></span> + <span></span> + <span></span> + </div> + </div> + <div id="navbar-menu" class="navbar-menu"> + <div class="navbar-start"> + <a class="navbar-item" href="/CsvHelper/getting-started">Getting Started</a> + <a class="navbar-item" href="/CsvHelper/examples">Examples</a> + <a class="navbar-item" href="/CsvHelper/migration">Migration</a> + <a class="navbar-item" href="/CsvHelper/change-log">Change Log</a> + </div> + <div class="navbar-end"> + <a class="navbar-item" href="https://twitter.com/JoshClose"> + <span class="icon"> + <i class="fab fa-twitter"></i> + </span> + </a> + <a class="navbar-item" href="https://github.com/JoshClose/CsvHelper"> + <span class="icon"> + <i class="fab fa-github"></i> + </span> + </a> + </div> + </div> + </nav> +</header> + + + <main id="main" class="container is-fluid"> + <div class="columns is-variable is-1"> + <div class="column is-2"> + +<div id="sidebar" class="sidebar"> + <ul class=""> + <li> + <span> + <a class="expander"></a> + + <a href="/CsvHelper/examples/prerequisites">Prerequisites</a> + </span> + + <ul class="is-hidden"> + <li> + <span> + + <a href="/CsvHelper/examples/prerequisites/using-and-dispose">Using and Dispose</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/prerequisites/reading-and-writing-files">Reading and Writing Files</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/prerequisites/streams">Streams</a> + </span> + +</li> + +</ul> + +</li> + + <li> + <span> + <a class="expander"></a> + + <a href="/CsvHelper/examples/reading">Reading</a> + </span> + + <ul class="is-hidden"> + <li> + <span> + + <a href="/CsvHelper/examples/reading/get-class-records">Get Class Records</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/reading/get-dynamic-records">Get Dynamic Records</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/reading/get-anonymous-type-records">Get Anonymous Type Records</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/reading/enumerate-class-records">Enumerate Class Records</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/reading/reading-by-hand">Reading by Hand</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/reading/reading-multiple-data-sets">Reading Multiple Data Sets</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/reading/reading-multiple-record-types">Reading Multiple Record Types</a> + </span> + +</li> + +</ul> + +</li> + + <li> + <span> + <a class="expander"></a> + + <a href="/CsvHelper/examples/writing">Writing</a> + </span> + + <ul class="is-hidden"> + <li> + <span> + + <a href="/CsvHelper/examples/writing/write-class-objects">Write Class Objects</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/writing/write-dynamic-objects">Write Dynamic Objects</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/writing/write-anonymous-type-objects">Write Anonymous Type Objects</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/writing/appending-to-an-existing-file">Appending to an Existing File</a> + </span> + +</li> + +</ul> + +</li> + + <li> + <span> + <a class="expander"></a> + + <a href="/CsvHelper/examples/configuration">Configuration</a> + </span> + + <ul class="is-hidden"> + <li> + <span> + <a class="expander"></a> + + <a href="/CsvHelper/examples/configuration/class-maps">Class Maps</a> + </span> + + <ul class="is-hidden"> + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/mapping-properties">Mapping Properties</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/mapping-by-name">Mapping by Name</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/mapping-by-alternate-names">Mapping by Alternate Names</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/mapping-duplicate-names">Mapping Duplicate Names</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/mapping-by-index">Mapping by Index</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/auto-mapping">Auto Mapping</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/ignoring-properties">Ignoring Properties</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/constant-value">Constant Value</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/type-conversion">Type Conversion</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/inline-type-conversion">Inline Type Conversion</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/optional-maps">Optional Maps</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/class-maps/validation">Validation</a> + </span> + +</li> + +</ul> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/configuration/attributes">Attributes</a> + </span> + +</li> + +</ul> + +</li> + + <li> + <span> + <a class="expander"></a> + + <a href="/CsvHelper/examples/type-conversion">Type Conversion</a> + </span> + + <ul class="is-hidden"> + <li> + <span> + + <a href="/CsvHelper/examples/type-conversion/type-converter-options">Type Converter Options</a> + </span> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/type-conversion/custom-type-converter">Custom Type Converters</a> + </span> + +</li> + +</ul> + +</li> + + <li> + <span> + + <a href="/CsvHelper/examples/csvdatareader">CsvDataReader</a> + </span> + +</li> + + <li> + <span> + + <a href="#">Back to top</a> + </span> + +</li> + +</ul> + +</div> + + </div> + <div class="column"> + <div class="content"> + <h1 id="writing">Writing</h1> +<h2 class="title is-2 has-text-danger">Injection Warning</h2> +<p>When opening a CSV in an external program, a formula in a field could be ran that contains a vulnerability. +Read more here: <a href="https://owasp.org/www-community/attacks/CSV_Injection">CSV Injection</a>. +Due to this issue, there is a setting <code>InjectionOptions</code> that can be configured.</p> +<p>The list of injection characters to detect are configurable in <code>CsvConfiguration.InjectionCharacters</code> +and default to <code>=</code>, <code>@</code>, <code>+</code>, <code>-</code>, <code>\t</code>, <code>\r</code>. An injection character can be the first character of a field +or quoted field. i.e. <code>=foo</code> or <code>"=foo"</code></p> +<p>The <code>InjectionOptions</code> values are <code>None</code> (default), <code>Escape</code>, <code>Strip</code>, and <code>Exception</code>.</p> +<h6 id="none">None</h6> +<p>No injection protection is taken.</p> +<h6 id="exception">Exception</h6> +<p>If an injection character is detected, a <code>CsvWriterException</code> is thrown.</p> +<h6 id="strip">Strip</h6> +<p>All injection characters at the start of a field will be removed. <code>===foo</code> will be stripped to <code>foo</code>.</p> +<h6 id="escape">Escape</h6> +<p>If an injection character is detected, the field will be prepended with the <code>InjectionEscapeCharacter</code> +that defaults to <code>'</code>. The field will be quoted if it is not already.</p> +<p><code>=one</code> -> <code>"'=one"</code></p> +<p><code>"=one"</code> -> <code>"'=one"</code></p> +<p><code>=one"two</code> -> <code>"'=one""two"</code></p> +<p>This option is disabled by default because the primary goal if this library is to read and write CSV +files. If you are storing user entered data that you haven't sanitized yourself and you're letting +it be accessed by people that may open in Excel/Sheets/etc, you might consider enabling this feature. +The <code>InjectionEscapeCharacter</code> is not removed when reading.</p> +<p>When writing, you can throw an enumerable of class objects, dynamic objects, anonymous type objects, or pretty much +anything else, and it will get written.</p> +<table> +<thead> +<tr> +<th>Topics</th> +<th> </th> +</tr> +</thead> +<tbody> +<tr> +<td><a href="/CsvHelper/examples/writing/write-class-objects">Write Class Objects</a></td> +<td></td> +</tr> +<tr> +<td><a href="/CsvHelper/examples/writing/write-dynamic-objects">Write Dynamic Objects</a></td> +<td></td> +</tr> +<tr> +<td><a href="/CsvHelper/examples/writing/write-anonymous-type-objects">Write Anonymous Type Objects</a></td> +<td></td> +</tr> +<tr> +<td><a href="/CsvHelper/examples/writing/appending-to-an-existing-file">Appending to an Existing File</a></td> +<td></td> +</tr> +</tbody> +</table> + + </div> + </div> + </div> + </main> + + <br /><br /> + + <footer id="footer" class="footer"> + <div class="has-text-centered">© 2009-2022 Josh Close</div> +</footer> + + + + <script> + hljs.configure({ + tabReplace: " " + }); + hljs.initHighlightingOnLoad(); + </script> + <script src="/CsvHelper/scripts/header.js"></script> + <script src="/CsvHelper/scripts/sidebar.js"></script> + +</body> +</html> |