CJ said:
Can someone tell me what this error means and how to get rid of it.
ADODB.Stream adodbstream = new ADODB.Stream();
adodbstream.Type = ADODB.StreamTypeEnum.adTypeText;
adodbstream.Charset = "US-ASCII";
adodbstream.Open();
Error 1 No overload for method 'Open' takes '0' arguments
C:\Projects\Form1.cs 36 13 FormNew
Other have already told you that you are missing some arguments.
C# and VBS behave a bit different regarding missing arguments.
I has this piece of VBS:
Set stm = CreateObject("ADODB.Stream")
stm.Open
stm.Position = 0
stm.Charset = "UTF-8"
stm.WriteText "ABCÆØÅ"
stm.SaveToFile "C:\utf8.txt"
stm.Close
to do the same in C# I had to:
using System;
namespace E
{
public class Program
{
public static void Main(string[] args)
{
ADODB.Stream stm = new ADODB.Stream();
stm.Open(Type.Missing, ADODB.ConnectModeEnum.adModeUnknown,
ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified, "", "");
stm.Position = 0;
stm.Charset = "UTF-8";
stm.WriteText("ABCÆØÅ", ADODB.StreamWriteEnum.adWriteChar);
stm.SaveToFile(@"C:\utf8.txt",
ADODB.SaveOptionsEnum.adSaveCreateNotExist);
stm.Close();
}
}
}
You need to do something similar.
Or use something else than ADODB.Stream - I find it hard to
belive that you can not achieve what you want by using the
..NET library.
Arne