|
ali zaidi wrote: Please it is to urgent
This[^] is worth reading
I am not getting what you are trying to do. If 10 threads call SendSMS1 method, you will get 10 browser windows open. Your code is not thread safe too. Explain your problem clearly to get help.
|
|
|
|
|
I m heaving URL that is used to send sms to a user that is in the url.
I have to read the username from the dataset and have to add this username into the url. now i have to open the webbrowser to hit the sms and now i have to wait for two or three seconds to uoto sms goes after it i need to open the web browser for the new user and have to send sms.
I do not know Threading but if i do not use threading the speed is to slow i want send sms at lest to atlest ten users at a time though i could save my time
|
|
|
|
|
ali zaidi wrote: now i have to open the webbrowser to hit the sms and now i have to wait for two or three seconds to uoto sms goes after it i need to open the web browser for the new user and have to send sms.
This is not a good way to do. Don't they provide some kind of web services to send SMS ? In your method, for 1000 rows, you will have 1000 browser windows opened. Joseph Albahari has written a great article on threading here[^]. It's worth reading. CP also has some great article on threading, try to search for it.
|
|
|
|
|
Yesterday I didn't get any reply so maybe today someone can help me:
hi guys, I am almost desperate about this, I was trying for whole day yesterday, I want to set the initial directory for OpenFileDialog on FTP folder. How I can do that please help me. If someone knows some example it will be great to share with me. Thx Ahead
|
|
|
|
|
Try this
mOpenFileDialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, userName, password);
mOpenFileDialog.ShowDialog(this);
Be careful using the username password because if they are wrong the dialog will ask the user for a username password in a pop up
|
|
|
|
|
no, it doesn't work, I am still getting the my local C;/ directory when the OpenFileDialog popups, I am going through each line in the code, and everything is going smoothly, but when I am expecting to see the requested ftp directory, I am still getting my locak C:/ directory
|
|
|
|
|
Can you post some code? Where you set the dialogs initial directory?
|
|
|
|
|
so it is something like this:
I have a button for retrieving files from FTP directory and here is the code what I have in the button click event:
OpenFileDialog dialog = new OpenFileDialog();
string server = "someServer";
string username = "someUser";
string password = "somePass";
dialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, username, password);
dialog.ShowDialog(this);
|
|
|
|
|
|
This should work. If the user name and password are wrong it should prompt you for them
Did you step thru the code with the debugger and see whether the initial dir is being set?
|
|
|
|
|
yep, it shows me. Initial Directory is:
"ftp://myUserName:myPassword@myFTPaddress"
|
|
|
|
|
Ok are you sure you are not setting it again after that??
|
|
|
|
|
no..after that I have just ShowDialog(), and I have the OpenFileDialog displayed
|
|
|
|
|
Hi i am creating a form in this form i want to add a line so that at design time while i am designing the form but i did not find any contro to add to my form How i can do this
wasim khan
|
|
|
|
|
Your best bet is to handle the paint event and draw a line on the form
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Here's how:- Add a Label control to your form
- Set its "BorderStyle" property to Fixed3D
- Set its "Text" property to an empty string (or null)
- Clear the "Autosize" property
- Set the control's height (or width) to 2, depending on whether you want a horizontal or vertical line.
/ravi
|
|
|
|
|
i got my answere
Just Draw a group and make it Height to 2 with no Text
it will draw a horizontal line
wasim khan
|
|
|
|
|
wasimsharp wrote: Just Draw a group and make it Height to 2 with no Text
Actually, that doesn't render as well as a Label (see my earlier reply). If you look closely at the R edge, you'll see a few bad pixels.
/ravi
|
|
|
|
|
k thanx Ravi it really help its looking nice then my one
wasim khan
|
|
|
|
|
You might consider, if you have the time, to write your own small custom line control. Then it will be painted exactly how you want with the styling that you want and it will not be messed up by any OS visual styles. However, it seems like most programmers suggest the label routine mentioned previously, I find that creating a new control adds your own custom touch to your applications.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
My code is serializing a generic list of objects of class IOExtension. The IOExtension has two properties :
string Name
object Value
The serialization occurs without issue and provides the following XML:
<Culture>
<CodeCulture xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GlobalExtensions>
<CultureItemOfIOExtension ID="" Type="MyNamespace.MyClass.IOExtension, MyNamespace.MyClass, Version=2.0.0.0, Culture=neutral, PublicKeyToken=03604d72884e7711">
<IOExtension>
<Name>GlobalExtensions</Name>
<Value xsi:type="xsd:string">GlobalValue</Value>
</IOExtension>
</CultureItemOfIOExtension>
</GlobalExtensions>
</CodeCulture>
</Culture>
This is all great, except when I go to deserialize the XML I get an exception on the Value property:
Namespace prefix 'xsd' is not defined.
Now I've done some testing and it appears that this does not occur when I serialize a single instance of the IOExtension object. This would appear to be an issue with serializing the generic list of objects but I'm not sure. I've thought about implementing System.Xml.Serialization.IXmlSerializable but I'm not sure how to go about serializing the object itself. Any suggestions or thoughts out there ?
I'm hoping that I can define the namespace manually somehow but obviously my knowledge of Xml Serialization is limited.
|
|
|
|
|
Your xmlns attributes MUST be on the root element.
|
|
|
|
|
Hey Leppie, thanks for the response. I tried your suggestion but, unfortunately the following Xml deserialied with the same error:
<?xml version="1.0" encoding="utf-8"?>
<!--CodeCulture Culture File-->
<!--Created: 6/27/2008 8:27:23 AM-->
<!--Version: 1.0.0.0, Culture=neutral, PublicKeyToken=null-->
<!--Server: ISI-MBLDEV111-->
<CodeCulture xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>Sample</Name>
<Version>1.0</Version>
<GlobalExtensions>
<CultureItemOfIOExtension ID="" Type="IOExtension, Component, Version=2.0.0.0, Culture=neutral, PublicKeyToken=03604d72884e7711">
<IOExtension>
<Name>GlobalExtensions</Name>
<StringValue>GlobalValue</StringValue>
<Value xsi:type="xsd:string">GlobalValue</Value>
</IOExtension>
</CultureItemOfIOExtension>
</GlobalExtensions>
</CodeCulture>
|
|
|
|
|
My delete button doesnt work.
protected void bn_delete_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
int StaffID = Int32.Parse(GridView1.DataKeys[row.RowIndex].Value.ToString());
SqlCommand cmd = new SqlCommand("DELETE FROM Staff Where StaffID = '" + row.RowIndex + "'");
lb_msg.Text = "Record Deleted Successfully.";
GridView1.EditIndex = -1;
GridView1.DataBind();
}
}
|
|
|
|
|
I suggest you do some reading. I don't see any code here that actually calls your command, let alone associates it with a database. Is this the first time you've tried to write DB code ? There's tons of examples on the web, any example on how to use a SqlCommand will do.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|