А в следующий раз вопросы с неотформатированным кодом будем тихо удалять
-- GSerg
- Код: Выделить всё
Sub WriteTextToFile()
Dim questname As Object
Dim spname As Object
Dim flashstr As IDataObject = Clipboard.GetDataObject()
Dim ss As Object
Dim qtxt As Object
Dim nextsym As Object
Dim I As Object
ss = CType(flashstr.GetData(DataFormats.Text), String)
Do Until nextsym = "#"
I = I + 1
nextsym = Mid(ss, I, 1)
If nextsym = "#" Then Exit Do
questname = questname + nextsym
Loop
qtxt = Mid(ss, I + 1)
Dim file As New System.IO.StreamWriter(questname)
file.WriteLine(qtxt)
file.Close()
End Sub
Но бейсик материться:
Error 1 Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:
'Public Sub New(path As String)': Argument matching parameter 'path' narrows from 'System.Object' to 'String'.
'Public Sub New(stream As System.IO.Stream)': Argument matching parameter 'stream' narrows from 'System.Object' to 'System.IO.Stream'.