以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Dot NET,C#,ASP,VB 』  (http://bbs.xml.org.cn/list.asp?boardid=43)
----  跪求哪位能帮忙把下面的VB翻译成C#  有急用谢谢  (http://bbs.xml.org.cn/dispbbs.asp?boardid=43&rootid=&id=25373)


--  作者:kobegenius
--  发布时间:12/13/2005 9:55:00 PM

--  跪求哪位能帮忙把下面的VB翻译成C#  有急用谢谢
Dim a As Integer
Private Sub Command1_Click()
If a < File1.ListCount Then

File1.Selected(a) = True
a = a + 1
Else
a = 0
End If


End Sub

Private Sub Command2_Click()
CommonDialog1.CancelError = True
On Error GoTo errhandler
CommonDialog1.Filter = "BMP图象文件(*.bmp)|*.bmp|JPG图象文件*.jpg|*.jpg"
CommonDialog1.ShowSave
CloseFile (CommonDialog1.FileName)
errhandler:
End Sub
Public Sub CloseFile(FileName As String)
Dim F As InputModeConstants
F = FreeFile
Open FileName For Output As F
Print #F, frmCD!txtCD.txt
FileName = CommonDialog1.FileName

End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
a = 0
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
a = 0
End Sub

Private Sub File1_Click()

SelectedFile = File1.Path & "\" & File1.FileName
a = File1.ListIndex
Image1.Picture = LoadPicture(SelectedFile)
End Sub


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms