• 쇼핑몰
  • 커뮤니티
  • 북마크

vb.net


[Controls] [vb.net] SaveFileDialog 예제

하나를하더라도최선을
2021.06.04 06:23 160 0

본문



<Obsolete>
Private Sub button13_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button13.Click
Dim myStream As Stream
Dim saveFileDialog1 As SaveFileDialog = New SaveFileDialog()
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
saveFileDialog1.FilterIndex = 2
saveFileDialog1.RestoreDirectory = True
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
If (IT_HUB_TemClass.checked(myStream, saveFileDialog1.OpenFile())) IsNot Nothing Then
Dim byteData() As Byte
byteData = Encoding.ASCII.GetBytes(Clipboard.GetText)
'myStream = New FileStream("streamtest.txt", FileMode.Append)
myStream.Write(byteData, 0, byteData.Length)
myStream.Close()
End If
End If
End Sub
Private Class IT_HUB_TemClass
<Obsolete("Please refactor calling code to use normal Visual Basic assignment")>
Shared Function checked(Of T)(ByRef target As T, value As T) As T
target = value
Return value
End Function
End Class


댓글목록 0

등록된 댓글이 없습니다.