prova a mettere prima dell' if
Dim enc As System.Text.ASCIIEncoding

e nell' if,
enc = new ...