Hola quiero traducir este pequeño visual basic para .net la cuestión es que no tengo mucha experiencia con este lenguaje de programación. Y el problema se me presenta sobre todo en el for el código en c# es:
//var stream
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Manifest");
//Console.WriteLine(stream);
FileStream fileStream = new FileStream(appDataPath+ @"\tola.exe", FileMode.Create, FileAccess.Write);
for (int i = 0; i < stream.Length; i++)
fileStream.WriteByte((byte)stream.ReadByte());
fileStream.Close();
RunInternal(appDataPath + @"\tola.exe", "1234");
Intente algo parecido en vb.net:
Dim stream As Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("skip.skip.exe")
'Console.WriteLine(stream);
Using outFile As New System.IO.FileStream(appDataPath+"\tola.exe", IO.FileMode.Create, IO.FileAccess.Write)
For i = 0 To stream.length Step 1
outFile.Read((byte)stream.ReadByte())
Next
outFile.Close()
End Using
Pero me devuelve errores en readbyte()
, los errores son:
'.' expected. (BC30287) - 'Byte' is a type and cannot be used as an expression. (BC30108) - 'inFile' is not declared. It may be inaccessible due to its protection level. (BC30451) -