|
hi
Am working on C# 2003 ,what is the function point to EOL End Of Line....i want o read string from textfile each 7 char read alone so i need end of line function>>>>>>
thanx
Amani
|
|
|
|
|
My guess would be to use the ReadLine function. You couldn't find this with a google search, or even using intellisense?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: or even using intellisense?
sorry, but that requires somesense
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Too plain solution, too plain channels for a hacker.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I need to develop an application that can compare an Excel spreadsheet with some data that I can view on an internal site
My plan was to
-read the data from Excel into a dataset,
-get the data from the site in XML format and
-then compare this.
My question is - do you think this is the best way to solve this? i.e. get the data from Excel into a dataset, get the data in XML format from the site to a dataset, and compare the two?
I'm not even sure that the data I get from the site is in a format that can be compared to the Excel data as the tables aren't the same, so I will probably have to modify it so as to make them in a similar format before comparing
any input appreciated
edit: re-reading this i m not sure its clear:
source 1 :: Excel
source 2 :: Data on an internal site
objective: compare the 2
suggestions: see above
question: best solution
|
|
|
|
|
Hard to say from the info you peovided. maybe you should think of some parsers.
SkyWalker
|
|
|
|
|
Basically i don't need an optimal way to do this as this will run once a week only from a local machine - no particular speed requirements
Let's say that the database info I get from the site is similar to the one I have on Excel, can I just confirm that I can connect to the Excel using ado.net and get the data in a dataset. I will then have an XmlTextReader with raw XML data from the site - convert that into a dataset and compare the two datasets.
Does this plan make sense?
|
|
|
|
|
You have, I guess, the software requirements,so it's entirely up to you to set the approach to solving your problem.
SkyWalker
|
|
|
|
|
Hi,
I have a Windows based application and I'd like to make some validations before running (like license or something)
My question is if I do those validations inside the application main form and it's not successfuly done, I'd like to quit, I'd would prefer a friendly "Not Registered Application" message and then close it than throwing an exception.
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmGuardian());
}
}
public FrmGuardian()
{
if (!validInstall())
this.Close();
using (FrmSplash splash = new FrmSplash())
{
splash.Show();
InitializeComponent();
splash.Close();
}
}
In the current code I get
Cannot access a disposed object.
Object name: 'FrmGuardian'.
Thanks,
Dirso
|
|
|
|
|
Hey
What line causes the exception. And also have you tried doing the validation on form load, see if it still happens?
Let me know if it helps.
Thanks
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|
|
You can put the verification either into the Load event handler of your form and do the Close() there, or just put the verification before all the Application.XXX calls in the Main method, this way the form will not be created at all.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi Dirso,
You can put the validation code in your Main method, before you even instantiate your form.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
That would be the best solution, but I'd like some general solution that would work for Console Applications too.
for example, what If one of my funcional classes can't load because its configuration is missing or if some device is offline... First, I ask if the user wants to try again, but if it quits, I need to shut it down.
Thanks,
Dirso
|
|
|
|
|
Console apps have a Main method too A console app exits when you return from Main .
You could also add a reference to System.Windows.Forms if you want to show a message box or even a form. That would kind of subvert the console format, though.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Nick Butler wrote: Console apps have a Main method too Confused A console app exits when you return from Main.
I know... and I haven't thinking about moving my code to other methods than the construtors... I'll give it a try
thanks,
Dirso
|
|
|
|
|
Dirso wrote: public FrmGuardian()
{
if (!validInstall())
this.Close(); // here I tried Application.Exit and Application.ExitThread
using (FrmSplash splash = new FrmSplash())
Exit from the C'tor before executing the remaining code..
if (!validInstall())
{
this.Close();
return;
}
*jaans
|
|
|
|
|
|
As we already told you, you can do this in the Load event handler of your form.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes, and it is a good idea. But I'd like something more general that could work on Console Applications too.
Thanks,
Dirso
|
|
|
|
|
What about the Main method then? Console applications also have a Main method.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You should do all of your form initialization in the FormLoad method, and call Application.Exit() from that method if needed.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
hi,
i developed for a comercial application a quite complex gui framework based on forms, with windows manager and docking manager, where the forms could have various contents, from datagrids to media players.
it al works nice, except for one problem:
i have a main form (something like a mainframe) and a set of owned forms. suposing that the main application form is MainFrame, for all the owned forms, let's say Owned1, Owned2, etc. i set OwnedX.Owner = MainFrame.
the problem is that in some circumstancies my OwnedX forms end by being displayed, in the z-order, behind MainFrame form (i figured out that by making the MainFrame form semitransparent). when i click on either MainFrame form, or on any of the OwnedX that are still visible, everithing comes back to normal, and all the owned forms are displayed on top of the owner.
the problem is that even if MSDN states that a owned form couldn't be displayed before owner form, it happens. let me mention again that in my application i have multiple forms, with a very diversified content (up to 5 media players, using IVideoWindow component, datagrids, all kind of controls, from editboxes to buttons). what is specific to my forms is that they don't have a captionbar and a border, i emulate them using HT_XXX notifications, but i doubt that this is the problem as everithing works fine until something triggers abnormal behaviour, when a owned form goes behind owner form, and when the owner form is activated by clicking on it the owned forms is displayed back on top of the owner form.
i'm using visual studio 2005, .net framework 2.0 and windows xp with service pack 3 (it happened with service pack 2 too). i supose that is something in .net framework but, of course, i cannot tell where.
if anybody has an idea on what cause that, or encountered the same problem, please try to explain me where i do wrong.
best wishes, and thank you,
calin
|
|
|
|
|
Hard to say what is actually causing the owned forms to go behind the owner one. You could try handle the Deactivate event of one of your owned forms and see what the call stack looks like.
SkyWalker
|
|
|
|
|
hi,
i tried to handle activate, deactivate, set focus, focus lost, position changed (as much as possible without entering a infinte loop). no efect. the callstack, and also the messages seen with windows spy, looks ok. it is something ouside my code, most likely soemwhere deep in .net framework...
thank you,
calin
|
|
|
|
|
Hey
I need to detect when the content of the screen has changed i.e. a window has been opened or a tooltip pops up or basically any change from one snapshot of a screen to the next. The first way I have considered doing this is periodically taking a screen shot in code and then comparing the bitmaps for differences but this could lead to missing screen changes if my interval of snapshots is too large.
However this is inneficient and possibly very slow. Does any one know if there is some sort of OS event I can request notify me if the screen content changes and better yet which area of the screen has changed?
Although this is in the C# section pointers to any C++ resources would also be very helpful.
Thanks
At university studying Software Engineering - if i say this line to girls i find they won't talk to me
Dan
|
|
|
|