|
namespace cheshmak
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
static int i;
static int x = 0;
string text = "Hello Welcome (^_^) ";
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Interval = 111;
label1.Text = text;
switch (x)
{
case 0:
label1.ForeColor = Color.Red;
break;
case 1:
label1.ForeColor = Color.Yellow;
break;
case 2:
label1.ForeColor = Color.Red;
break;
}
if(++x > 1)
x = 0;
label1.Text = text.Substring(0,i+1);
i++;
if (i == text.Length)
{
timer1.Interval = 3000;
i = 0;
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.CenterToScreen();
label1.FlatStyle = FlatStyle.Popup;
}
}
}
|
|
|
|
|
Was there a question in here or were you just posting code for the hell of it??
|
|
|
|
|
And what's the problem, except not reading this[^] and not posting a question?
|
|
|
|
|
As the others have mentioned, is there a problem?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
Hi all,
I want to implement Nested Datagrid With Dynamic RowdetailsTemplate.The depth of RowDetailsTemplate can go to n levels.
Ex:
initially Datagrid ll contain 2 rows
Item1
Item2
and when Item1 is clicked another Datagrid with its child will appear say
Item1
Item1A
Item1B
Item2
when Item1A is Clicked another grid with its childs will appear
Item1
Item1A
Item1A1
Item1A2
Item1B
Item2
This tunnel can go to n levels.
How to achieve this with rowdetails template or else any other way
Thanks and regards,
karim
|
|
|
|
|
|
I'm trying to build my C# project, I get the error:
The modifier 'abstract' is not valid for this item
Is the item: FieldChanged;
In the following Interface:
namespace program.Drawing.Fields
{
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public interface IFieldHolder
{
abstract event FieldChangedEventHandler FieldChanged;
void AddField(Field field);
Field GetField(FieldType fieldType);
List<Field> GetFields();
bool HasField(FieldType fieldType);
void RemoveField(Field field);
void SetFieldValue(FieldType fieldType, object value);
}
}
|
|
|
|
|
|
Can you gave me a fix in my code
|
|
|
|
|
You just need to remove the abstract declaration for the event.
namespace program.Drawing.Fields
{
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public interface IFieldHolder
{
event FieldChangedEventHandler FieldChanged;
void AddField(Field field);
Field GetField(FieldType fieldType);
List<Field> GetFields();
bool HasField(FieldType fieldType);
void RemoveField(Field field);
void SetFieldValue(FieldType fieldType, object value);
}
}
|
|
|
|
|
Just to expand slightly on the (correct) fix already posted: You can't put 'public' or 'abstract' on interface members, because by definition they are already public and abstract, so to prevent confusion* no access modifiers are permitted.
*: or that's what the rationale is, anyway. I think it's silly, it prevents future expansion and the fact that the default scope (public abstract) in an interface is different from that (private) in a class is more confusing than making you write 'public abstract' on things in interfaces.
|
|
|
|
|
I think it makes sense that everything in an Interface is public and abstract by definition, but I don't like default modifiers on class members.
|
|
|
|
|
|
how to authenticate the user using the active directory and then finally assign certain exccess level to the user....any help..
private bool AuthenticateAD(string userName, string password, string domain, out string message)
{
message = "";
DirectoryEntry entry = new
DirectoryEntry("LDAP://" + domain, userName, password);
try
{
object obj = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + userName + ")";
search.PropertiesToLoad.Add("cn");
SearchResult result = search.FindOne();
if (null == result)
{
return false;
}
}
catch (Exception ex)
{
message = ex.Message;
return false;
//throw new Exception("Error authenticating user. " + ex.Message);
}
return true;
}
|
|
|
|
|
You can omit the DirectorySearcher. When object obj = entry.NativeObject; succeeded, everything is OK, you can already return true .
|
|
|
|
|
Hi,
Try this to List all the users from current domain.
public static void getUser()
{
DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.UserDomainName);
string userNames = "";
string authenticationType="";
foreach (DirectoryEntry child in directoryEntry.Children)
{
if (child.SchemaClassName == "User")
{
userNames += child.Name + Environment.NewLine;
authenticationType += child.Username + Environment.NewLine;
}
}
Console.WriteLine("************************Users************************");
Console.WriteLine(userNames);
Console.WriteLine("*****************Authentication Type*****************");
}
And this for Getting a particular user details from user's active directory
public static void fnImp() {
using (var context = new PrincipalContext(ContextType.Domain, Environment.UserDomainName))
{
using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
{
foreach (var result in searcher.FindAll())
{
DirectoryEntry de = result.GetUnderlyingObject() as DirectoryEntry;
if ((string)de.Properties["givenName"].Value == Environment.UserName)
{
Console.WriteLine();
PropertyCollection pc = de.Properties;
foreach (PropertyValueCollection col in pc)
{
Console.WriteLine(col.PropertyName + " : " + col.Value);
Console.WriteLine();
}
}
}
}
}
Console.ReadLine();
}
|
|
|
|
|
I believe that you can't authenticate a password like that against the AD; would be a security-risk, wouldn't it?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I put code into my program's UnhandledException handler that will write a Minidump using PInvoke to call the native MiniDumpWriteDump function.
However when I opened the resulting minidump in VS 2010, it contained no exception information or stack information.
Is it because the exception was "being handled" by the handler that there is no exception information?
Must I allow the program to crash, and write the dump from some outside program for there to be exception information in the minidump?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Compare your version of the code to this one[^]. The article also states what happens when you reach the exception-handler, and what's on the stack at that moment.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks. That looks like a good link.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
i want insert data from ORA to SQL 2000. and i would like use any Data Component for this idea. is possible to read from ora and insert read data to my table in SQL?
whats your idea?
|
|
|
|
|
Ubun2OS wrote: is possible to read from ora and insert read data to my table in SQL?
Yes. A simple way is to have a class to read data from Oracle (so you'll be using the Oracle data commands) and another one to write data into Sql Server (so you'll be using the Sql Server commands). Simply implement a model class to hold your data - and fill this from the Oracle one and pass it into the Sql Server one to perform the update.
Or, you could get SQL Server to do this all for you simply by writing a transformation with your Oracle database as the source of the data.
|
|
|
|
|
|
Have a 5 from me. BTW - with SQL 2000, it's DTS not SSIS.
|
|
|
|