|
I tried typing WebRequest but I dont know how to get system.net class.. do you have any dll or know where I can download it... Also any code sample for WebRequest and WebResponse in c# would be great...
Thanx..
|
|
|
|
|
|
Hi all,
I have created an application in C#.
The application will be distributed to many users.
Some new features will be added later to the app.
Now i want to create a functionality that will be like
Whenever the app starts, it will first check on the server for
files with new version and should replace the existing with new version files. I want the app to automatically download the new dll's and replace the existing ones with these new ones.
Any reference or link or sample code in this regard will be appreciated.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
you can use setup factory setup 7.0 {Search it fro google} for your product! their you will find the auto update functionality inside which conncet your product to server....
|
|
|
|
|
That seems to be some product.
I don't have to use external products.
Is there any feature in .Net for this.
Or some customized code?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
If the app is 2.0 based you can use Click-Once. Otherwise look at the Updater Application Block from Microsoft's Patterns & Practices group.
only two letters away from being an asset
|
|
|
|
|
I don't know how to minimize my program in system tray.
Please answer me.
Vasildb
|
|
|
|
|
using System.Windows.Forms;
//button event
private void btnTray_Click(object sender, System.EventArgs e)
{
// Hide the main form, as a program running as a tray icon doesn't typically
// have a visible form.
this.Hide();
ntfSystemInfo.Visible = true;
ntfSystemInfo.Text = "System Information";
}
//the code is not enfough please see help in msdn
|
|
|
|
|
Thanks. But if the code is not enough.
I have Visual Studio 2003.
Vasildb
|
|
|
|
|
Adding tray icons and context menus[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi,
Using csharp and the .net farmework i could run a thread like this and update the UI such as a label.
example :
Thread mythread = new Thread(new Threadstart(myfunction));
mythread.Start();
void myfunction()
{
lblstatus.text = DoWork();
}
Now using this same code which works in vS 1.1 dont wanna update the UI label in net 2.0 Why ??
Im using c# expression edition .
Thanks in advance
|
|
|
|
|
Trance Junkie wrote: Now using this same code which works in vS 1.1 dont wanna update the UI label in net 2.0
What do u mean? throws an exception, hangs?
From what i know, you should never use a non UI thread to update the UI, it causes it to deadlock.
|
|
|
|
|
Hi thanks for the speedy reply
No, it does not even get an exception, nothing of that sort and it does not even hang. emmm
this is very strange....
|
|
|
|
|
It's not safe to access UI controls from threads other than the one they were created on. It mostly results in a freezing UI or other strange things. You're lucky nothing of this happened in your case. As there are many other people like you who weren't aware of this problem and accessed UI controls from other threads, it's no longer allowed. Use Invoke or BeginInvoke to update your label. This article[^] should help you.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you Stefan i`ll check out the article.
|
|
|
|
|
Richtextbox scenario:
Two RTB's with syncronized scrollbars. I get scrollinfo from the left and use that position to update RTB2 on the right. When i call SetScrollInfo for RTB2 the Scrollbar seems to move to correct position but it doesn't actually scroll down the text like it's neighbour on the left.
Can anyone tell me why or what I'm doing wrong?
|
|
|
|
|
Hello
SetScrollInfo doesn't actually scrolls. It changes the scrolling parameters as the name implies. Yes the little thumb moves up and down but it doesn't really scroll the content of the associated control. Revise the answer I posted to your earlier post, maybe it would help.
PS.
I guess you are using API calls? Why you jump low level that fast?
Regards
|
|
|
|
|
|
hello I have purchesed
the visual studio 2005
but I don't how the create an XML file.
does some one know how to create an XML?
|
|
|
|
|
Right click on your project in the solution explorer, add new item and select the XMLfile template. Or do you mean how to write in XML file?
BS
|
|
|
|
|
hi
i use access db and vs2005.
my problem is : i want in dataGridView_SelectionChanged event show fields of my database in some controls like textbox . i done this work and i gave good result . but when i delete a record in runtime the following error shown me:
Deleted row information cannot be accessed through the row.
i use datarow for add,update,delete row and use oledbdataadapter and use this
code to access fields of database and show it in some controls :
private void dataGridView1_SelectionChanged(object sender, DataGridViewCellPaintingEventArgs e)
{
if (this.BindingContext[ds_khane1, "Khaneh_1"].Position == -1)
return;
else
{
DataTable dt = ds_khane1.Tables["Khaneh_1"];
DataRow newrow = dt.Rows[dataGridView1.CurrentCell.RowIndex];
txt_name.Text = newrow["name"].ToString();
txt_family.Text = newrow["family"].ToString();
...
}note : i was use dataGridView1_CellPainting event and solved my problem,but why the above error shown me in dataGridView1_SelectionChangedevent and how to solve problem ?
thanks.
|
|
|
|
|
Hi all,
by making this.StartPosition = FormStartPosition.CenterScreen; works fine during design time, but when i change the size of form in load event, the form is not properly displayed in the center screen. eg.in the load event if i change the form's width and height. it did not display the form in the center screen, (ie upper left corner only centered with screen),
this is my code ( iam altering the forms width and height for the message to be displayed (custom messagebox)
private void CommnChkPopup_Load(object sender, EventArgs e)
{
this.Width = 460;
this.Height = 160;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
for (int len = 50; len < labelMessage.Text.Length; len = len + 50)
{
int i = labelMessage.Text.IndexOf("\n", (len - 50));
if (i > len || i == -1)
{
int j = labelMessage.Text.IndexOf(" ", len);
labelMessage.Text = labelMessage.Text.Insert(j, " \n");
}
}
if (this.Width < (labelMessage.Width + 92))
this.Width = labelMessage.Width + 92;
if (this.Height < (labelMessage.Height + 160))
this.Height = this.Height + labelMessage.Height;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.StartPosition = FormStartPosition.CenterScreen;
btnOk.Focus();
}
|
|
|
|
|
Hello
Here is a small code I wrote earlier to do the same thing:
Top = Screen.PrimaryScreen.WorkingArea.Height / 2 - Height / 2;
Left = Screen.PrimaryScreen.WorkingArea.Width / 2 - Width / 2;
Regards
|
|
|
|
|
i want to move a button on my form with mouse , it means that i want to Drag and Drop a button with mouse .
How could i do this?
|
|
|
|
|
Hello
You'd have to do it manually. Handle MouseDown to start dragging, MouseUp to stop dragging, and MouseMove to change the location of the buton according to the mouse new screen postion.
Regards
|
|
|
|