|
well PHP is not C# things work differently. So for one you need to be prepared to learn C# if you want to use it.
One .DLL file can contain just 1 class or it can contain many classes. If they are static classes you can use thier methods directly, if they are non-static you can create instances of the classes and use them as desired.
You can reference the DLL as needed in your ASP.Net application
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
How can i convert MouseEventArgs to ByteArray?
and how can i serilize a MouseEventArgs ?
Thankyou
YPKI
|
|
|
|
|
ypki wrote: How can i convert MouseEventArgs to ByteArray?
What information are you expecting to have stored in this array?
.... sterilize a mouse
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I guess you want to send MouseEventArgs using Socket. In simple language, MouseEventArgs is class and class cannot be converted to byte array but its variables can.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I am working on a program in C# which is supposed to simulate a very simple browser. The program lets user login on yahoo and allows to compose and send mail (for now). For the last couple of weeks it was working just fine but since yesterday whenever it attempts to send mail the html having the following message (from yahoo) is returned:
Sorry for the inconvenience.
You've stumbled upon an unexpected, temporary problem. Performing your action again in a few moments will likely resolve the problem completely. If not, we suggest you try re-launching Yahoo! Mail.
If the problem persists, feel free to contact Customer Care about Error Code 14.
I have used about three yahoo accounts but in vain. Can't figure out why does this message appear . Please help.
|
|
|
|
|
I suggest asking Yahoo, its their error message. Have you tried just logging on and sending an email via the yahoo site to see if you get the same problem?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi,
I want to add more than one controls like lable, text box for a single cell to the datagridview control.
Thanks in Advance.
modified on Thursday, March 19, 2009 8:18 AM
|
|
|
|
|
Can you even add one?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I can add one control but i cant add more than one.
my requrement is to add more one control to the single cell and select each control
Tqs for the response
|
|
|
|
|
How do you add one control? As far as im aware the different controls you mention are just different styles of datagridview cells.
In which case the same question could be asked. how do i add 2 textboxes to 1 textbox? answer is you cant
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
its not to add 1 control to another control
add to cell those controls and select each control individually.
when you select single control, need to show some properties.
|
|
|
|
|
I know what you are trying to achieve, but my point is that controls cant be added to datagridview cells. Maybe i am mistaken, that why i ask how you can add one control?
Post come code showing how you have managed to add one control to a datagridview cell then maybe i can help you better with your needs
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi All,
I have very little experience with threading and have been building an object that creates a thread internally (not sure this is even a good design idea). Just as an example I have created this class (with a delegate):
public delegate void ThreadCompleterEventHandler(object sender, ThreadCompleteEventArgs args);
public class ObjectThatCreatesAThread
{
public event ThreadCompleterEventHandler ThreadCompleted;
private Thread t;
public ObservableCollection<string> StringsCollection;
public ObjectThatCreatesAThread()
{
StringsCollection = new ObservableCollection<string>();
}
public void PopulateStringsCollectionOnOtherThread()
{
t = new Thread(delegate()
{
DoWork();
});
t.Name = "Populate StringsCollection Thread";
t.Start();
}
private void DoWork()
{
StringsCollection.Add("String1");
StringsCollection.Add("String2");
StringsCollection.Add("String3");
OnThreadCompleted();
}
private void OnThreadCompleted()
{
ThreadCompleted(this, new ThreadCompleteEventArgs());
}
}
This object is created by a button click on a WPF UI. Like:
private void RunThread_Click(object sender, RoutedEventArgs e)
{
obj = new ObjectThatCreatesAThread();
obj.ThreadCompleted += new ThreadCompleterEventHandler(obj_ThreadCompleted);
obj.PopulateStringsCollectionOnOtherThread();
}
In the eventhandler in the UI I have:
void obj_ThreadCompleted(object sender, ThreadCompleteEventArgs args)
{
StringsListBox.ItemsSource = obj.StringsCollection;
}
Which throws a InvalidOperationException "The calling thread cannot access this object because a different thread owns it.". Which is easily rectified by doing this instead:
void obj_ThreadCompleted(object sender, ThreadCompleteEventArgs args)
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(delegate()
{
StringsListBox.ItemsSource = obj.StringsCollection;
}));
}
My question is why does the DoWork() method running on the spawned thread gain ownership of the StringCollection object that was in fact constructed on the UI thread?
Is there any way to move this collection back to the ownership of the UI thread without the need for the Dispatcher.BeginInvoke()
Am I actually just trying to code around a bad practise?
I would prefer to make this object as user friendly as possible so that even though it is spawning a thread internally at the end of the threads execution the collection is made available to other threads to work with, I guess specifically the UI thread. Is there anything I can set at thread construction time to facilitate this?
Thanks,
|
|
|
|
|
Change the signature for the OnThreadCompleted method and try the following.. I have not tested the code:
private void OnThreadCompleted(object sender, ThreadCompleteEventArgs e)
{
System.ComponentModel.ISynchronizeInvoke sync;
if (ThreadCompleted != null)
{
foreach (Delegate d in this.ThreadCompleted.GetInvocationList())
{
sync = d as System.ComponentModel.ISynchronizeInvoke;
if (sync != null)
{
if (sync.InvokeRequired)
{
ThreadCompleterEventHandler del = new ThreadCompleterEventHandler(OnThreadCompleted);
object[] args ={ sender, e };
sync.BeginInvoke(del, args);
return;
}
}
this.ThreadCompleted(sender, e);
}
}
}
|
|
|
|
|
Wow ... thanks for this ...
I just tried this code and I'm getting a StackOverflowException on:
this.ThreadCompleted.GetInvocationList();
If I put a breakpoint on this line and look at the ThreadCompleted object the _invocationList has a count of 0 even though I know there is at least one subscription to the event ...
|
|
|
|
|
If you email me your solution, i can assist you further.
|
|
|
|
|
Thanks for this offer Fayu, where should I send the solution?
Thanks,
|
|
|
|
|
Check your email. I sent you my e-mail address.
|
|
|
|
|
I looked at your code and it seems like you are using WPF. This changes things. Multithreading is a little different in WPF. The code below should resolve your issue:
if (ThreadCompleted != null)
{
Window caller = (Window)this.ThreadCompleted.Target;
if (!caller.Dispatcher.CheckAccess())
{
ThreadCompleterEventHandler del = new ThreadCompleterEventHandler(OnThreadCompleted);
object[] args = { sender, e };
caller.Dispatcher.Invoke(del, args);
return;
}
this.ThreadCompleted(sender, e);
}
Hope this helps.
modified on Friday, March 20, 2009 8:53 AM
|
|
|
|
|
hello ,
i would like to use Rejex to validate a user name.
my user name rules are as follows:
1. first character is a letter : a-z, A-Z
2. other characters can be letters , numbers and _
3. a space can be used only once.
i tried this one but it didnt work :
Boolean Result = false;
string PatternString = @"[_-zA-Z0-9\s]$";
Result = Regex.Match(UserNameString, PatternString).Success;
tnx in advance,
avi
|
|
|
|
|
im not 100% but try...
"[a-zA-z][a-zA-z0-9_]*[ ]?[a-zA-Z0-9_]$"
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
hi,
its semi working.
there is a problem with the initial value.
i can enter the following string: ,jukj
and it will also be successfull.
tnx,
avi
|
|
|
|
|
oh yes, you need to make it specify to use the start of the string, i think ^ does that job...
"^[a-zA-z][a-zA-z0-9_]*[ ]?[a-zA-Z0-9_]$"
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
You also probably need another asterisk in there right before the $. Otherwise it'll only allow one more character after the optional space.
|
|
|
|
|
cool
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|