<asp:Button ID="Button1" runat="server" Text="Button" OnClick = "Button1_Click"/> protected void Button1_Click(object sender, EventArgs e) { //write your code }
string.IsNullOrEmpty(string value);
public enum Active_Inactive { Active = 0, Inactive = 1 }
Public Enum Active_Inactive Active = 0 Inactive = 1 End Enum
Dim enum_obj As Active_Inactive Dim value As Integer = 1 enum_obj = CType(value,Active_Inactive) MasBox(enum_obj.ToString())
Active_Inactive enum_obj; int value = 1; enum_obj = (Active_Inactive)value; MessageBox.Show(enum_obj.ToString());
enum_obj = CType(System.ComponentModel.TypeDescriptor.GetConverter(enum_obj).ConvertFrom("Active"),Active_Inactive) MasBox(enum_obj.ToString())
enum_obj = (Active_Inactive)TypeDescriptor.GetConverter(enum_obj).ConvertFrom("Active"); MessageBox.Show(enum_obj.ToString());
enum_obj = CType(System.Enum.Parse(GetType(Active_Inactive), "Active"),Active_Inactive)
enum_obj = (Active_Inactive)Enum.Parse(typeof(Active_Inactive), "Active");
MessageBox.Show(Active_Inactive.Active); MessageBox.Show(Active_Inactive.Inactive);
//C# foreach(int value in Enum.GetValues(typeof(Active_Inactive))) { MessageBox.Show(value); } 'VB.Net For Each value In [Enum].GetValues(GetType(Active_Inactive)) MessageBox.Show(value) Next
MsgBox([Enum].GetName(GetType(Active_Inactive),1)) //Where 1 is an Index Position of Enum Values
MessageBox.Show(Enum.GetName(typeof(Active_Inactive),2));
For Each value In [Enum].GetNames(GetType(Active_Inactive)) MessageBox.Show(value) Next foreach(string value in Enum.GetNames(typeof(Active_Inactive))) { MessageBox.Show(value); }
public enum DateFormatStyle { Rounded, Truncated }; Public Enum DateFormatStyle Rounded Truncated End Enum
FileAttributes fa = System.IO.File.GetAttributes("file_name_path");
if(((File.GetAttributes("file_path") & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)) { return true; } return false;
if(((File.GetAttributes(filePath) & FileAttributes.Hidden) == FileAttributes.Hidden)) { return true; } return false;