Witam,
string[] csv = Regex.Split(File.ReadAllText(dlg.FileName).Replace("\"", ""), "\n");
for (int i = 0; i < csv.Length-1; i++)
{
string[] csvline = Regex.Split(csv[i],";");
for (int j = 0; j < csvline.Length; j++)
{
dynamic d = wb.Document;
if (d.readyState == "complete")
{
d.getElementById("parcel_form_trucker_type_recipientName").value = csvline[0];
d.getElementById("parcel_form_trucker_type_recipient_street").value = csvline[1];
d.getElementById("parcel_form_trucker_type_recipient_houseNumber").value = csvline[2];
d.getElementById("parcel_form_trucker_type_recipient_flatNumber").value = csvline[3];
d.getElementById("parcel_form_trucker_type_recipient_zipCode").value = csvline[4];
d.getElementById("parcel_form_trucker_type_recipient_city").value = csvline[5];
d.getElementById("parcel_form_trucker_type_recipient_phone").value = csvline[6];
d.getElementById("parcel_form_trucker_type_recipient_email").value = csvline[7];
}
}
}
Z tego co zauważyłem błąd wyskakuje tylko w przypadku, gdy robię jakiekolwiek odwołanie do wb.document albo d.
Uprzedzam z góry - jestem "bardzo" zielony w C#.
An unhandled exception of type 'System.NotSupportedException' occurred in System.Dynamic.dll
Additional information: Wyjątek od HRESULT: 0x800A01B6
Prosiłbym o szczegółową pomoc :)
Pozdrawiam.