|
You would need to use P/Invoke interop calls to some of the Win32 API calls. I'm not sure which ones off-hand.
There is a potentially easier way, which would be to make use of the HttWebRequest object and the HTML parser[^] found in this article.
You would need code similar to this:
HttpWebRequest webRequest = WebRequest.Create("http://www.codeproject.com") as HttpWebRequest;
string html = "";
if (webRequest != null)
{
HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse;
if (response != null)
{
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
html = reader.ReadToEnd();
}
}
}
if (html.Length > 0)
{
HtmlParser parser = new HtmlParser();
HtmlNodeCollection nodes = parser.Parse(html);
HtmlNodeCollection tables = nodes.FindByName("table");
HtmlNode table = tables[6];
} As you can see, you can access the HTML in a similar method as you would XML, or you can load it directly into an XmlDocument (once you have selected a single HtmlNode element by using the following:
XmlDocument xml = new XmlDocument();
xml.LoadXml(table.XHTML);
XmlNodeList tableRows = xml.SelectNodes("//tr");
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Hi
Here is the scenario of exception handling for my applications:
I have a translator that translate exceptions to a meaningful message for user.
When an unhandled exception occurs there is an Application ThreadException handler that is supposed to catch and handle the exception(To translate it using the translator and show a message box to user)
When I compile my solution and run the exe file everything goes fine but when I'm in debug mode it doesn't work and if there's an unhandled exception the debugger stops and shows me the exception.
What should I do to use my Exception handling scenario even while I'm debugging?
Thanx
|
|
|
|
|
Hi,
I susggest you have a look at the menu Debug/Exceptions...
|
|
|
|
|
Hi guys. i have two Questions to make sure the serialization of objects does not alter the following concepts:
i may use windows application with either mdb or MS SQL database.
Is it possible to those database files such as micrsoft access or microsoft SQL to convert binary format, like BIN files extension?
OR with those database files above can be converted in to dll files?
thanks so much for helping..
so much of happy ending...
|
|
|
|
|
zafax4 wrote: i may use windows application with either mdb or MS SQL database.
Yes.
zafax4 wrote: Is it possible to [missing verb] those database files such as micrsoft access or microsoft SQL to convert binary format, like BIN files extension?
I don't understand the question.
zafax4 wrote: OR with those database files above can be converted in to dll files?
I don't see how converting a database to a DLL would be helpful in anyway. A DLL file is fairly static. It generally does not change. In fact, while the program is running it cannot change as the operating system locks the file. By contrast, database files tend to change all the time.
|
|
|
|
|
I don't think any of your questions actually impact object serialization in any way.
You can use a Windows application with any database technology you want. Typically the actual database files are in a proprietary format specific to the database engine (technology) and aren't human-readable. If you want to prevent someone from opening the database outside of your application (through a database management tool) then you need to use the database security mechanisms to password protect your database.
DLLs are not used for data like this. If you want to "embed" the database in to your application, you should look at Microsoft SQL Server Compact Edition[^]
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Thanks you so much scott its really helpful and im happy that u helped me.
i need to database to be embeded in the application as you said, but i dont want to do security externally by using password.
thanks lot!
so much of happy ending...
|
|
|
|
|
You're welcome. The best option would probably be SQL Server CE (Compact Edition). It has a very small runtime footprint (2 DLLs) and stores the entire databse in a single file. It is very compatible with the full-blown SQL Server and pretty easy to work with.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Thanks Scott lot!
Just now im in the website u given , i'll go through this more and found some helpful samples too!.
scott i really appreciate you being so helpful. thanks .
so much of happy ending...
|
|
|
|
|
I'm very new to C sharp, having come from a c++ and vb background.
Within VS2005, I have a script (MainForm.Designer.cs) that defines all the components in my project (mostly toolstripmenus, buttons, labels, comboboxes etc.), the events attached to them etc
However, every time I try to group the code into logical blocks (including using regions) and save it, when I re-open VS mixes it all up again. I've gone through the help and even tried MSDN, but haven't found a way around this.
Anyone got any ideas?
Thanks in Advance,
John.
|
|
|
|
|
Hi,
all .Designer.cs files are generated automatically by Visual Designer;
you are not supposed to modify them in any way other than through the Designer.
So you should put your own code in one or more separate files.
|
|
|
|
|
Thanks Luc,
Just so I understand correctly, are you suggesting that I put the code from the designer script into my own script and simply call the functions from the designer script?
Best,
John.
|
|
|
|
|
why would you do any of that?
Leave the Designer code as is, where it is; the .Designer.cs files are part of your
project, they will be included in all your builds.
And there is nothing to call except for InitializeComponent(), which should be called
as the first statement in your form's constructor (the wizzard will have put it there
for you too).
|
|
|
|
|
You'll notice that your MainForm.cs and MainForm.Designer.cs both have:
public partial class MainForm
within the same namespace.
The designer file is handled by the IDE and automatically updated everytime design changes are made (this can include project opening etc).
You shouldn't normally make any changes to the designer file yourself. Your own 'functions' and calls to them should be added in the MainForm.cs file, or alternatively create your own MainForm.Functions.cs and/or MainForm.FunctionCalls.cs file and start these files with the namespace required and the public partial class MainForm { .... }
|
|
|
|
|
jgrogan wrote: are you suggesting that I put the code from the designer script into my own script and simply call the functions from the designer script?
No, leave them as they are.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Please help me.
How can we know wheather a user entered text in text box is in correct date format(dd/mm/yyyy). i want to show an error message when entered text is not in correctdate(dd/mm/yyyy) format.please send solution to me .thank you in advance.
|
|
|
|
|
|
use try{cast text to date}/catch (InvalidCastException ){here do what do u want}
|
|
|
|
|
I'm glad you got good answers for your question, however next time, I suggest you use more helpful subject for your posts.
Cheers,
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
use DateTime.Parse() or DateTime.ParseExact().
|
|
|
|
|
Use a more useful subject line next time
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Don't give the option to enter the date by user.
Give the option to select the date from the calender.
Display a popup calender and select the date from it.
Make the textfield for the date to be "readonly".
dhans
|
|
|
|
|
Hi Friends,
I am using datagridviewcheckbox column in datagridview. I have a probelm for clicking checkbox column. The problem is, On datagrid_CellMouseClick event, for clicking checkbox when getting value(selected/not selected) for checkbox column for this event. The checkbox value is null. How can i get checkbox value(selected/not selected) using datagridview?
Thanks in advance
Rameshkumar Thirumalaisamy
|
|
|
|
|
|
please who u can use datagridview in WindowsCE alpplication I search 4 it alot but I don't find. I usually use datagrid and who u use checkbox in it.
I answered with a question (like politicals) sorry but please help me.
|
|
|
|