AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.10" />

 PlaintextFormDataSetVisitor

using AngleSharp.Dom.Io; using System.Collections.Generic; using System.IO; namespace AngleSharp.Html.Submitters { internal sealed class PlaintextFormDataSetVisitor : IFormSubmitter, IFormDataSetVisitor { private readonly List<string> _lines; public PlaintextFormDataSetVisitor() { _lines = new List<string>(); } public void Text(FormDataSetEntry entry, string value) { if (entry.HasName && value != null) Add(entry.Name, value); } public void File(FormDataSetEntry entry, string fileName, string contentType, IFile content) { if (entry.HasName && content != null && content.Name != null) Add(entry.Name, content.Name); } public void Serialize(StreamWriter stream) { string value = string.Join(Symbols.NewLines[0], _lines); stream.Write(value); } private void Add(string name, string value) { _lines.Add(name + "=" + value); } } }