Issue to argument

Peter_1985 2,686 Reputation points
2022-03-31T06:47:54.807+00:00

Hi,
How to resolve issue below

Argument 1: cannot convert from 'string' to 'System.IO.Stream'

on this line?

using (StreamWriter sw = new StreamWriter(@"c:/cmp/list10.txt", allowappend, Encoding.Unicode))

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,022 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,167 questions
{count} votes

Accepted answer
  1. Viorel 118.1K Reputation points
    2022-03-31T07:20:55.933+00:00

    It will work if allowappend is a bool variable (true or false).

    Also you can use this path: @"c:\cmp\list10.txt".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.