|
can any body tell me that i have install my application.
My application is running while running i want to update configuration file can i do this
wasim khan
|
|
|
|
|
Well there's nothing stopping you from doing it. The file isn't locked or anything.
Weather your app picks up the changes is probably also up to you, you might have to have a FileSystemWatcher watch the file and reload settings if it changes.
Try it.
Simon
|
|
|
|
|
|
I am heaving thousands of rows in a Dataset, First i have to read the first row and have to start a process that sends the message to the rows values ,and then i have to wait for completing the task then the same work will go for the next row and so on..... Acctually what i want , I want to use threads though more then ont process could run at a time so i save my time,Please it is to urgent
I m doing like this .............
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Thread[] th;
private void button1_Click(object sender, EventArgs e)
{
th = new Thread[10];
for (int i = 0; i < 10; i++)
{
th[i] = new Thread(new ThreadStart(SendSMS1));
}
foreach (Thread t in th)
{
t.Start();
}
}
SqlConnection con;
SqlDataAdapter da;
DataSet ds;
DataSet dsAddRow;
private void Form1_Load(object sender, EventArgs e)
{
con = new SqlConnection(@"Data Source=NZN-7FC996E32D7\SQLEXPRESS;database=smscube;integrated security=true");
string str = "SELECT S.*,U.[name] AS 'UserName',Se.SenderID AS 'pCode','0' AS 'aCode',0 AS 'Type',U.password FROM SMSLog1 S LEFT OUTER JOIN UserLogin U ON S.UserID=U.UserID LEFT OUTER JOIN usersenderid Se ON Se.UserID=S.UserID";
da = new SqlDataAdapter(str, con);
ds = new DataSet();
dsAddRow = new DataSet();
i = 0;
da.Fill(ds);
}
static int i;
public void SendSMS1()
{
if (ds.Tables[0].Rows.Count <= i)
return;
string username =Convert.ToString( ds.Tables[0].Rows[i]["UserName"]);
string password =Convert.ToString( ds.Tables[0].Rows[i]["Password"]);
string type =Convert.ToString( ds.Tables[0].Rows[i]["TYPE"]);
string pcode =Convert.ToString( ds.Tables[0].Rows[i]["pCode"]);
string acode =Convert.ToString( ds.Tables[0].Rows[i]["aCode"]);
string mobilenumber =Convert.ToString( ds.Tables[0].Rows[i]["MobileNo"]);
string message = Convert.ToString(ds.Tables[0].Rows[i]["Text"]);
Process curPro= Process.Start("http://203.145.131.149:81/login/pushurl.php?USERNAME=" + username + "&PASSWORD=" + password + "&TYPE=" + type + "&pcode=" + pcode + "&acode=" + acode + "&mnumber=" + mobilenumber + "&message=" + message);
curPro.WaitForExit();
i++;
}
}
|
|
|
|
|
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.
|
|
|
|