Aşağıda visual basicle yazılmış kodlar c # dilinde kullanacağım şekilde duzenleyebilirmisiniz?
(Kodlar postaguvercini sistemini kullanarak sms gonderme kodları)



2.1 VISUAL BASIC
2.1.1 SMS GONDERME
Private Sub Command1_Click()
Dim obj As Object, cnt As Long, id As Variant, res As Variant, oo As Long, ee As String
Dim expdt As Date, dt As Date

'' Objeyi oluştur
Set obj = CreateObject("fyPostaGuvercini.GateToServer")
'' İşlemi başlat
Call obj.Start("XXXX", "XXXX")
‘’SMS ekle
Call obj.SmsInsert("53299999xx", "Test", Now)
‘’Hata kontrolu
If obj.ErrorOccurred 0 Then
MsgBox "HATA:" & obj.ErrorString(obj.ErrorOccurred)
GoTo theEnd
End If
dt = DateAdd("n", 2, Now) ‘ 2 dakika sonra gonder
expdt = DateAdd("n", 60, dt) ‘ 60 dakika icinde gitmezse iptal et
Call obj.SmsInsert2("53299999xx", "Test2", dt, expdt)
If obj.ErrorOccurred Then
MsgBox obj.ErrorString(obj.ErrorOccurred) & " ** " & obj.ErrorOccurred
GoTo theEnd
End If

oo = obj.End()
oo = obj.ErrorOccurred
If oo 0 Then
ee = obj.ErrorString(oo)
MsgBox "Hata: " & oo & " " & ee
GoTo theEnd
End If

cnt = obj.ResultOfInsert(-1, id, res)
For i = 1 To cnt
oo = obj.ResultOfInsert(i - 1, id, res)
MsgBox id & " ** " & res
Next

theEnd:
Set obj = Nothing
End Sub

2.1.2 SMS DURUM SORGULAMA
Private Sub Command2_Click()
Dim obj As Object, cnt As Long, id As Variant, res As Variant, oo As Long, ee As String

Id = “” ‘’Onceden gonderilmiş bir mesaj

'' Objeyi oluştur
Set obj = CreateObject("fyPostaGuvercini.GateToServer")

'' İşlemi başlat
Call obj.Start("XXXX", "XXXX")

‘’ Status sorgusu ekle
Call obj.SmsStatus(id)
If obj.ErrorOccurred 0 Then
MsgBox "HATA:" & obj.ErrorString(obj.ErrorOccurred)
GoTo theEnd
End If
oo = obj.End()
oo = obj.ErrorOccurred
If oo 0 Then
ee = obj.ErrorString(oo)
MsgBox "Hata: " & oo & " " & ee
GoTo theEnd
End If
cnt = obj.ResultOfStatus(-1, id, res)
For i = 1 To cnt
oo = obj.ResultOfStatus(i - 1, id, res)
MsgBox id & " *Status* " & res
Next

theEnd:
Set obj = Nothing
End Sub
__________________