|
I published a C# Forms application to a directory on my server called ... /www/appBeta/ and the installation folder URL was /appBeta/
Everything worked and we decided to take the application live.
So I changed my publish folder to /www/app/ and the installation folder URL to /app/ and it seems that Visual Studio has cached the installation folder of Beta/
It correctly published the application to the /www/app/ directory, but the setup in that directory references the /appBeta/ directory.
I have shut down and restarted VS, I have rebooted my computer and I have gone through the publishing wizard again. The directories are correct in my project setting, but the published version has the OLD directory for the installation folder.
Why is it doing this? I have seen I can go back and manually change the installation URL, but it is frustrating to see my project settings are not applied. Where is this old directory getting cached and how to I remove it so I can do a clean build and publish with the correct settings?
|
|
|
|
|
request all to help me for the following issue...
1.As a part of the requirements in my application there will be a windows service running 24/7.
2.this windows service will launch a windows application(GUI) to take user input..
The above application worked fine till windows XP...
but on windows vista & windows 7
before launching application from windows service an "interactive Service Desktop" pop-up is launched automically with options "view my app" and "ask me later"
by clicking on "view my app"...my application GUI popup is launched....otherwise it is not launched...
How to avoid the intermediate popup i.e.,"interactive service desktop"?
Please help me..
|
|
|
|
|
|
Why can't you use a DataGridView? It seems just the thing to display a table like you want. Obviously you would need to write code to populate the DGV unless the data exists in a database or some other file.
What does this mean?
mrkeivan wrote: create a 2*2 matrix
This would only give you four entries unless you mean each cell in the table is a 2*2 matrix.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
see we have the hours (which is taken form one table) and class rooms ( which is taken from another table)
so I dunno how many I'm going to have, I guess I have to get these values from the user then dynamically create a new table with these info.
|
|
|
|
|
i have two datatable
dt1,dt2
i want to merg its columns to newdatatable
then make gridview datasource newdatatable
|
|
|
|
|
|
Hi,
Do you know any safe and reliable approach to convert a VB.Net solution to C# one?(Framework 3.5)
Best wishes
|
|
|
|
|
mehrdadc48 wrote: safe and reliable approach
I'm sure there are plenty of tools available if you do a search on the internet.
IMO, the safest and most reliable to do this would probably be to do it yourself. Sorry.
|
|
|
|
|
|
Any of the commercial utilities will do this well - VB to C# and C# to VB conversion are both very established. Also, C# and VB(.NET) both use the same framework, so that's an entire level of conversion that you don't have to worry about.
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hi there. I'm continuing to learn c# but moved on to the .net 4 compact framework. I have this piece of code i am using in a project. All though it does what i want it too, it feels to clunky and no need for multiple methods. I just don't know how to optimize it.
I am trying to get it to do everything in the responsehandler, without the need for 3 of the same methods. It means my code wont be clunky and unoptimized and i believe all the feeds with display at once and not at different times.
but fyi its using system.xml and system.servicemodel.syndication --typo
namespace NewsTap
{
public partial class NewsFeed : PhoneApplicationPage
{
object _selectedItem;
public NewsFeed()
{
InitializeComponent();
SupportedOrientations = SupportedPageOrientation.Portrait;
Loaded += new RoutedEventHandler(MainPage_Loaded);
PageTransitionList.Completed += new EventHandler(PageTransitionList_Completed);
string bbc = "http://www.pchelpforum.com/external.php";
string dailyMail = "http://www.dailymail.co.uk/home/index.rss";
string guardian = "http://www.guardian.co.uk/tv-and-radio/rss";
HttpWebRequest bbcRequest = (HttpWebRequest)HttpWebRequest.Create(new Uri(bbc));
bbcRequest.BeginGetResponse(new AsyncCallback(ResponseHandler), bbcRequest);
HttpWebRequest DailyMailRequest = (HttpWebRequest)HttpWebRequest.Create(new Uri(dailyMail));
DailyMailRequest.BeginGetResponse(new AsyncCallback(ResponseHandlerdaily), DailyMailRequest);
HttpWebRequest GuardianRequest = (HttpWebRequest)HttpWebRequest.Create(new Uri(guardian));
GuardianRequest.BeginGetResponse(new AsyncCallback(ResponseHandlerguardian), GuardianRequest);
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
ResetPageTransitionList.Begin();
}
#region getting feed
private void ListBbc_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
_selectedItem = (sender as ListBox).SelectedItem;
PageTransitionList.Begin();
}
private void ListDailyMail_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
_selectedItem = (sender as ListBox).SelectedItem;
PageTransitionList.Begin();
}
private void ListGuardian_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
_selectedItem = (sender as ListBox).SelectedItem;
PageTransitionList.Begin();
}
private void PageTransitionList_Completed(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/DetailsPage.xaml", UriKind.Relative));
FrameworkElement root = Application.Current.RootVisual as FrameworkElement;
root.DataContext = _selectedItem;
}
private void ResponseHandler(IAsyncResult asyncResult)
{
HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);
if (response.StatusCode == HttpStatusCode.OK)
{
XmlReader reader = XmlReader.Create(response.GetResponseStream());
SyndicationFeed newFeed = SyndicationFeed.Load(reader);
ListBbc.Dispatcher.BeginInvoke(delegate
{
ListBbc.ItemsSource = newFeed.Items;
});
}
}
private void ResponseHandlerdaily(IAsyncResult asyncResult)
{
HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);
if (response.StatusCode == HttpStatusCode.OK)
{
XmlReader reader = XmlReader.Create(response.GetResponseStream());
SyndicationFeed newFeed = SyndicationFeed.Load(reader);
ListDailyMail.Dispatcher.BeginInvoke(delegate
{
ListDailyMail.ItemsSource = newFeed.Items;
});
}
}
private void ResponseHandlerguardian(IAsyncResult asyncResult)
{
HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);
if (response.StatusCode == HttpStatusCode.OK)
{
XmlReader reader = XmlReader.Create(response.GetResponseStream());
SyndicationFeed newFeed = SyndicationFeed.Load(reader);
ListGuardian.Dispatcher.BeginInvoke(delegate
{
ListGuardian.ItemsSource = newFeed.Items;
});
}
}
#endregion
}
}
Any help would be great. Thanks in advance to any repliers,
malcomhfc
|
|
|
|
|
Well, lets see what's in common between your three methods. Everything is the same except for the address you read and which ItemsControl you are filling. If you combined those two things into a separate class, you could simplify the form code.
The class would look something like this:
public class FeedReader
{
FeedReader(string address, ItemsControl target)
{
_address = address;
_target = target;
}
private string _address;
private ItemsControl _target;
public void LoadFeed()
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(_address));
request.BeginGetResponse(new AsyncCallback(ResponseHandler), request);
}
private void ResponseHandler(IAsyncResult asyncResult)
{
HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);
if (response.StatusCode == HttpStatusCode.OK)
{
XmlReader reader = XmlReader.Create(response.GetResponseStream());
SyndicationFeed newFeed = SyndicationFeed.Load(reader);
_target.Dispatcher.BeginInvoke(delegate
{
_target.ItemsSource = newFeed.Items;
});
}
}
}
And the calling code could then be:
public NewsFeed()
{
InitializeComponent();
SupportedOrientations = SupportedPageOrientation.Portrait;
Loaded += new RoutedEventHandler(MainPage_Loaded);
PageTransitionList.Completed += new EventHandler(PageTransitionList_Completed);
FeedReader bbc = new FeedReader("http://www.pchelpforum.com/external.php", ListBbc);
FeedReader dailyMail = new FeedReader("http://www.dailymail.co.uk/home/index.rss", ListDailyMail);
FeedReader guardian = new FeedReader("http://www.guardian.co.uk/tv-and-radio/rss", ListGuardian);
bbc.LoadFeed();
dailyMail.LoadFeed();
guardian.LoadFeed();
}
|
|
|
|
|
Ah great modified it to my liking. Much shorter and more readable
Thank you a lot. Sorry for my late reply was back to college this week.
|
|
|
|
|
hey all,
I've implemented progressbar in backgroundWorker...
the progressbar changes on backgroundWorker_ProgressChanged
now i want to upgrade the progress bar, and to add it the progress percent display
that's what i did so far :
private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
...
progressBar1.Value = e.ProgressPercentage;
progressBar1.Refresh();
int percent = (int)(((double)progressBar1.Value / (double)progressBar1.Maximum) * 100);
progressBar1.CreateGraphics().DrawString(percent.ToString() + "%", new Font("Arial", (float)8.25, FontStyle.Regular), Brushes.Black, new PointF(progressBar1.Width / 2 - 10, progressBar1.Height / 2 - 7));
}
but the problem is , each progress bar change, the percent text is blinking... (i hope you understand what i meant to)
any idea how to solve that ?
thanks
modified on Sunday, April 18, 2010 7:05 AM
|
|
|
|
|
Hi,
several comments:
1.
you should turn your progress bar (or the container holding it) into a double-buffered one; there is a property for that.
2.
you should not redo the progress bar stuff if the value hasn't changed, so put it all in a if (progressBar1.Value != e.ProgressPercentage) {...}
3.
you should dispose of all objects you created but no longer need whenever they offer a Dispose() method. Here it is the Graphics you ordered, and the Font (which you could store as a class member and reuse).
[ADDED]
There are several related articles here on CodeProject; here is just one: Extended ProgressBar[^]
[/ADDED]
|
|
|
|
|
solution #1, what does it do ?
solution #2,
why progress bar should not be changed ? each time the backgroundWorker_ProgressChanged executed, the value is changed...
solution #3,
to store font as a class member and reuse it, it saves object creation time during the runtime ?
actually I've solved it differently (and it works ok)
i just added Thread.sleep(150); before the method ends...
modified on Sunday, April 18, 2010 7:42 AM
ok, my solution doesn't help much, the percent text doesn't blink anymore, but the thread.sleep stuck the whole gui...
but non of your tips haven't helped me either...
|
|
|
|
|
DoubleBuffered is the name of a property. That will do the trick. Set it to true.
|
|
|
|
|
already did it... no change
|
|
|
|
|
I suggest doing the following:
1. Extend the ProgressBar class and Set a property for DisplayText.
2. Everytime the displaytext is changed, you can invalidate the progressbar.
3. Draw the progressbar by overriding the onpaint event.
4. From the background worker, only update the progressbar's DisplayText property.
|
|
|
|
|
can you please share with me what you've done ?
I'm new with all the graphic change stuff, therefor your example will help/teach me ...
thanks in advance
|
|
|
|
|
I overlooked the complete answer provided by Luc.
Luc has provided a link to a custom progress bar. That would be the best thing to do for now.
<added>
What I have done is in my software. And it was basically to create various colored custom bars. It was similar to the link that Luc has provided.
|
|
|
|
|
another strange issue,
after the percent counting is finishes, the percent string disappears just after the progressBar.value got to it maximum value.
that's the code
private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
...
progressBar1.Value = e.ProgressPercentage;
progressBar1.Refresh();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
updateText();
}
private void updateText()
{
int percent = (int)(((double)(progressBar1.Value - progressBar1.Minimum) /
(double)(progressBar1.Maximum - progressBar1.Minimum)) * 100);
using (Graphics gr = progressBar1.CreateGraphics())
{
gr.DrawString(percent.ToString() + "%",font, Brushes.Black,
new PointF(progressBar1.Width / 2 - (gr.MeasureString(percent.ToString() + "%",
SystemFonts.DefaultFont).Width / 2.0F),
progressBar1.Height / 2 - (gr.MeasureString(percent.ToString() + "%",
SystemFonts.DefaultFont).Height / 2.0F)));
}
Thread.Sleep(100);
}
in this code, the percent string disappears...
but i notcide that if i add another progress bar (progressBar2) and at the end (in backgroundWorker_RunWorkerCompleted ) i add progressBar2.Value = X; , the percent in progressBar1 (the percent remain on his place after the maximal value was reached)
what can it be ? and how can i solve it ?
thanks
|
|
|
|
|
|
Emran Hussain wrote: I did not find any section dedicated to Visual Studio
On the left hand side of the screen, under "General Discussions", second forum below "The Lounge": "Visual Studio"
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|