In this sample I wrote a windows application that gives you the C# method throw a simple 4 steps. I think that will be useful for the beginners to C# programming, and will help them to learn how to write a method in C#. This is the V 1.0 of the application I will write the enhanced V 1.1 that will enables you to add parameters to your method .
Writing unsafe code - pointers in C#
Constructors In C#
Hi, i have one ready made function in VB.Net but i want to use it in C#.Net.So tell me converted Code.The code is,Imports System.ConvertPartial Class EncDec Inherits System.Web.UI.Page Public Function SimpleEncrypt(ByVal TheText As String) As String Dim tempChar As String = Nothing Dim i As Integer = 0 For i = 1 To TheText.Length If ToInt32(TheText.Chars(i - 1)) < 128 Then tempChar = System.Convert.ToString(ToInt32(TheText.Chars(i - 1)) + 100) ElseIf ToInt32(TheText.Chars(i - 1)) > 128 Then tempChar = System.Convert.ToString(ToInt32(TheText.Chars(i - 1)) - 100) End If TheText = TheText.Remove(i - 1, 1).Insert(i - 1, (CChar(ChrW(tempChar))).ToString()) Next i Return TheText End Function Protected Sub butSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles butSubmit.Click If TextBox1.Text = "admin" Then txtResult.Text = SimpleEncrypt(txtText.Text) Else Label1.Text = "Enter Correct Password" End If 'txtResult.Visible = True 'butDecrypt.Visible = True 'txtText.Visible = False 'butSubmit.Visible = False End Sub Protected Sub butDecrypt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles butDecrypt.Click If TextBox2.Text = "admin" Then txtText.Text = SimpleEncrypt(txtResult.Text) Else Label1.Text = "Enter Correct Password" End If 'txtText.Visible = True 'butSubmit.Visible = True 'txtResult.Visible = False 'butDecrypt.Visible = False End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End SubEnd Class