|
I am working on a application on .net 2.0. Sometime would update the app.config setting. However, my app do not get the updated app.config setting until i rebuild the app.
Do anyone tell me y and help me fix the problem. Thanks~~~
|
|
|
|
|
Its not a problem, thats how it works...
When your changing the app.config from visual studio your changing the one that sits with your code, when you build the app a copy of it is created and put with the exe so that it can access the app.config
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi,
My problem is that I want to delete the nth line of a text file where n is the line number. I guess I could create StreamReader and use ReadLine() to read each line and store it in an array. Then I guess I could re-write the file using the array and omit the nth index.
But when I delete a line I don't want to renumber the subsequent lines. how I could do that?
Any guidance or help for this problem would be greatly appreciated.
Thanks,
Crul23
|
|
|
|
|
Renumber the subsequent lines? I don't follow that. Lines in a text file
are not numbered.
Otherwise I would suggest deleting the text in the line just leaving an
empty text line there. this would leave the same number of lines in the file, but delete the text of the line you want to delete.
Brian
|
|
|
|
|
Crul23 wrote: and store it in an array
I wouldn't do that if you could be passed a very large file. Better to write the lines to a temporary file as you go and then move/rename it to replace the original version when you're done.
You could even shift the content within the existing allocated space, but that might not be worth the trouble.
Crul23 wrote: I don't want to renumber the subsequent lines
Overwriting the existing line with SPACEs is simple.
Of course, if this is a class assignment, pick a way that will impress the teacher.
|
|
|
|
|
Hmm, this is a class assignment but I dunno if I'm suppose overwrite the line with spaces. Then again how else can the subsequent line numbers stay the same right? Hmm, I'll have to find out.
Also, what do you think would impress the teacher lol?
--Crul23
|
|
|
|
|
Crul23 wrote: Hmm, this is a class assignment but I dunno if I'm suppose overwrite the line with spaces. Then again how else can the subsequent line numbers stay the same right? Hmm, I'll have to find out.
What line numbers are you talking about? Text files in Windows do not have line numbers. Some editors will display line numbers once you load a text file into them, but the operating system doesn't provide these.
Crul23 wrote: Also, what do you think would impress the teacher lol?
If you don't know, you may want to ask your teacher, because we certainly can't tell you.
|
|
|
|
|
I have always added a "Settings" File to my project. Then used the Property Grid control to allow users to view/edit the Settings.
I'd like to allow for a cleaner configuration interface. (The property grid is just an table of all the options listed in alphabetical order) I'd like to be able to group options together and have things like checkboxes instead of True/False selections)
I have spent several hours searching for a good approach to binding windows forms controls to a Settings file or similar and surprisingly haven't come across anything quite like what i was looking for.
I did find some asp.net articles which allow for XMLDataSets to be binded to a form but this option doesn't appear to be available in C# Windows forms projects.
If someone could point me in the right direction, i'd really appreciate it.
Thanks in Advance,
~blake
http://www.blakerobertson.com
|
|
|
|
|
Hi,
My application working fine in the dev environment.But in the testing /production environment
it is not working because that environment has only
windows server 2003
IIS
I have prepared a MSI which will automatically install .net2.0 framework
In my application I have Used some microsoft VC++ dll's also along with .net dll's.
Now Iam getting "<b>RUNTime Error</b>" pop-up screen message as below
" <b>The Application has been terminated in an Unusual Way</b>"
On googling i came to know that some dll's like msvcrt.dll of windows server 2003 has to be changed...But Iam not pretty sure about it..
In Production/test environment there is only framework installed ,but there is no visual studio installed on it.may be due that this error may occur...
So kindly post your suggestions and views to help me
|
|
|
|
|
|
I want to add item to my listbox if a mouse is clicked in the area between the two items. Is that even possible couldn't find anything on famous www.google.com.
|
|
|
|
|
Not sure, but have a test with MouseDown event, which will give you coordinates and GetChildAtPoint method.
The need to optimize rises from a bad design
|
|
|
|
|
If u want to add item from another list box then in mouse click event you copy that item to clipboard then paste to whr u wsant
|
|
|
|
|
Commonly used solution is making a context menu with add item. When a user clicks on list item and selects add you can prompt for information and add new listitem just before the one user clicked.
|
|
|
|
|
First of all thanks for answering to my question. I am already using context menu either (Addup or below). But I have realized, that I don't like this kind of feature. Wouldn't it be nice to display a blinking cursor (I-horizontal bar) within the listbox or may be in between the listbox items. Any insight would be kindly appreciated.
|
|
|
|
|
Is this a Windows or a Web application?
|
|
|
|
|
|
Since this is a Windows app, you can do it (would be impossible using the Web controls unless you developed a completely custom list control). In fact, the first reply you received mentioned the functions you need to do it.
|
|
|
|
|
But how am I going to show an I-horizantal Bar or Bliking cursor within the listbox.
|
|
|
|
|
netJP12L wrote: But how am I going to show an I-horizantal Bar or Bliking cursor within the listbox.
First, what do you mean by "I-horizontal bar"?
Second, draw the listbox then draw your bar or cursor OVER the listbox. This is best done with a control derived from the list box with an overridden Paint method.
|
|
|
|
|
I meant control focused cursor. Usually we have it vertially. Same like in Power Point. Or similiar like when a TextBox or TextField recieve focus, that's the cursor I am refereing too
|
|
|
|
|
netJP12L wrote: I meant control focused cursor. Usually we have it vertially. Same like in Power Point. Or similiar like when a TextBox or TextField recieve focus, that's the cursor I am refereing too
Ah!! You need to create a cursor.
1. First, create the cursor in Visual Studio. This can be done easily by right-clicking your project, selecting Add New Item, select Local Project Items\Resources\Cursor File, then edit and save your cursor (we'll call it Horizontal.cur).
2. To create the cursor in C# and make it the current cursor:
Cursor.Current = new Cursor("Horizontal.cur");
|
|
|
|
|
netJP12L wrote: First of all thanks for answering to my question. I am already using context menu either (Addup or below). But I have realized, that I don't like this kind of feature. Wouldn't it be nice to display a blinking cursor (I-horizontal bar) within the listbox or may be in between the listbox items. Any insight would be kindly appreciated.
Truthfully, twenty one years of experience developing user interfaces gives me the feeling that this idea reads much better than it will look two years into the application's deployment. Is this simply a play application not intended for serious use by a lot of people, or is this intended for commercial use?
|
|
|
|
|
I am trying to develop a free-ware photo album.
|
|
|
|
|
Currently I have some code that does some searches via the reg expression in c#. I have a fuynction that returns a reg expression that simply strings and clean the string from HTML tags and the function is below(1). This function works just fine. Recently the code has a bug and the bug seems to be related with the following:
- between words there are multiple spaces and/or multiple nbsp so if the user searches for the "this is" it does not give the right matches if in between "this" and "is" may be multiple spaces, combination of amp;nbsp; and spaces and carriage returns. I am trying to do a test and do the code below which works as a test:
string str = "This is a test sentese.";
str = Regex.Replace(str, @" ", " "); //Remove nbsp
str = Regex.Replace(str, @"\s+", " "); //Remove duplicate spaces.
but how can I add the above logic in one sentese? how can I add the above logic part of the regular expression that strips the HTML below? Please help.
1. Function that cleans from html:
public static Regex GetRegExpStripHTML()
{
Regex r = new Regex(@"(<\/?)(?i <element>a(bbr|cronym|ddress|pplet|rea)?|b(ase(f" +
@"ont)?|do|ig|lockquote|ody|r|utton)?|c(aption|enter|ite|(o(de" +
@"|l(group)?)))|d(d|el|fn|i(r|v)|l|t)|em|f(ieldset|o(nt|rm)|ra" +
@"me(set)?)|h([1-6]|ead|r|tml)|i(frame|mg|n(put|s)|sindex)?|kb" +
@"d|l(abel|egend|i(nk)?)|m(ap|e(nu|ta))|no(frames|script)|o(bj" +
@"ect|l|pt(group|ion))|p(aram|re)?|q|s(amp|cript|elect|mall|pa" +
@"n|t(r(ike|ong)|yle)|u(b|p))|t(able|body|d|extarea|foot|h|itl" +
@"e|r|t)|u(l)?|var))(\s(?<attr>.+?))*>");
return r;
}
|
|
|
|