|
There is javascript on the page. Crap. I guess I'm going to have to retrieve with WebClient, and either parse the page myself or pass it into HAP so I can use the built-in parsing it has...
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
if you navigate to the page with a System.Windows.Forms.WebBrowser it would execute the scripts and I expect the result would be available as DocumentText . AFAIK you don't have to see the WebBrowser for it to do that, so it could probably be a lone Control inside an app that isn't even a WinForms app.
|
|
|
|
|
I was just trying to avoid changing my code (I'm lazy, that's all).
Another weird aspect of HAP is that it seems to get ID names that are different from what you see in the page source from a web browser. It took me considerable time this weekend to realize that.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I was just trying to avoid changing my code
I prefer modifying my own code a little over adding foreign code any day; more code means more problems, foreign means harder to get it right when it goes wrong.
|
|
|
|
|
Hey can you do me a favor?
Try to retrieve the date posted for one of your articles using HttpWebRequest. When I try it, I'm not getting back everything that'sdisplayed in the browser.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
if you mean getting the content of a page such as http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=648011[^] (as CP Vanity does), I did notice one of the dates for my list is off by one day. Never got around investigating it, it is still on my low-priority todo list. In my list Chris shows CP Vanity as updated on 06-APR-2010, whereas the app itself shows 05-APR-2010.
Are you suggesting:
1. you got similar phenomena?
2. it is somehow JavaScript related?
|
|
|
|
|
When I try to scrape an articles page, none of the data on the right side (date posted, date updated, views, and bookmarked) are returned when I use HtmlAgilityPack, WebClient, or HttpWebRequest. My last resort is to use the WebBrowser control to do the retrieval and then getting the html from it.
I don't know what Chris did, but this used to work. I suspect it's a javascript thing because there is a crapload of javascript in the page.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
Well, I tried using the WebBrowser control, and I can't due to the architecture of the code. It's pathetic, but if the user wants to get the date posted, he has to enter it manually. How f*cked up is that?
EDIT ===============
I figured out a way to try the WebBrowser, but I have tio wait until tonight to try it. Man this code is getting to be a nightmare.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
modified on Tuesday, May 4, 2010 8:29 AM
|
|
|
|
|
I have a simple desktop application called Hello World which i want to license. My requirement is that this application should install on one machine with a key but the key will not work for another machine. This is how i will stop illegal copies of software. Also on the 'legal' machine i will want to expire key say after 30 days like most trial software. How should i achieve this. I am already working on this solution but looking for better ideas. No third party components - only .NET stuff...All ideas are welcome...
J A Nasir K
|
|
|
|
|
|
u r posting me the 3rd party... i need pure dotnet brother...
J A Nasir K
|
|
|
|
|
I think for licensing .NET product whether it is Windows Application or
Web Application, there is only one way that is using third party tools.
.NET is not providing any functionality to license it's products.
You can also refer following tool.
http://www.devzest.com/DotNetLicensing.aspx?Show=Overview[^]
It is again paid.
Jinal Desai - LIVE
|
|
|
|
|
You can build your own licensing system, but believe me: It will save you a LOT of time if you find a readymade solution you can use. Even if some solutions are expensive, it's still nothing compared to the time you are going to save...
Take it from me. I did it the hard way myself...
|
|
|
|
|
Hi,
I want to create a webservice to which data is sent, for example a phonenumber or a customerID. And a acknowledge-message (ack of nack) is sent back my webservice.
I'm using C# .NET 2008.
Does ayone have some examples for how to get started?
How does a webservice know when a message is being sent?
Thanks
sirTachyon
|
|
|
|
|
Hello!
I have been looking in this article: Drawing Cards with Cards.dll[^] and wanted to try it out myself.
But I have not find out how to initialize the cards.dll on Windows 7. I downloaded cards.dll and put in under: c:\windows\system32. This is my code so far:
public partial class Form1 : Form
{
[DllImport("cards.dll")]
private static extern bool cdtInit(ref int width, ref int height);
public Form1()
{
InitializeComponent();
int width = 12, height = 12;
if (!cdtInit(ref width, ref height))
throw new Exception("cards.dll did not load");
}
}
The if-statement crashes with the a BadImageFormatException with this message (translated from Swedish to English):
"An attempt to read the program/application with bad format was made. (Exception from HRESULT: 0x8007000B)"
How shall I make this work?
|
|
|
|
|
It looks like you are trying to load a 32bit dll from a 64bit program. Are you using a 64bit os and compiling you program for any platform? If so you can try to compile your app for 32bit only (set the project’s properties from "any" platform target to "x86" - it will run also on 64bit systems) and see if it works.
Hope it helps.
|
|
|
|
|
|
Hi! is it possible that my dbase is sql2005 using php and javascript
becoz our existing system te dbase is sql2005 and we want to publish our system in web using php and javascript but our database is sql2005
|
|
|
|
|
Yes there is a driver for SQL Server in the php distributions. Further info can be found here[^], and you're in the wrong forum...
|
|
|
|
|
hi all
i have a method that will represent an mdiChild form
it works ! but i want it to return a form with the type of entered argument (formType) what should i do?
/////////////////////////////////
private Form Find(Type form)
{
foreach (Form frm in this.MdiChildren)
if (frm.GetType() == form)
return frm;
return null;
}
/////////////////////////////////
i tried to use this one but it does not work!
/////////////////////////////////
private Form Find(Type form)
{
foreach (Form frm in this.MdiChildren)
if (frm.GetType() == form)
return (form)frm;
return null;
}
/////////////////////////////////
would u help me what should i write instead of "return (form)frm;" ?
thanks!
|
|
|
|
|
It's because of your return type.
You should just return the child form that you found, and cast it to the desired type in the calling method.
You may also have to fully qualify the type you're passing in (MyApp.MyAppChildForm instead of just MyAppChildForm ).
MyApp.MyAppChildForm child = FindChildOfType(MyApp.MyAppChildForm);
if (child != null)
{
}
private Form FindChildOfType(Type formType)
{
foreach (Form child in this.MdiChildren)
{
if (child.GetType() == formType)
{
return child;
}
return null;
}
}
BTW, in the code snippet I posted, I changed the variable names in your Find method to something more appropriate.
EDIT - I changed the name of the method I posted to match the call the code was making... (slaps forehead)
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
modified on Monday, May 3, 2010 12:46 PM
|
|
|
|
|
thanks for your attention and variable`s name correction!
i do that conversion in my code ... but i what to make it better & more beautiful
i will try this kind of meaningful naming from now on !
but the problem still persists !
|
|
|
|
|
You could possibly make Find a generic method.
|
|
|
|
|
hi
would you give me a Little sample or show me a link about "Generics" that explain me this topic more simpler ?
|
|
|
|
|
Sure. Given a List<System.ValueType> (lis) containing values of different types, this will retrieve the first one that is of a specified type:
private static T
GetValue<T>
(
) where T : struct
{
T result = default(T) ;
foreach ( System.ValueType v in lis )
{
if ( v.GetType() == typeof(T) )
{
result = (T) v ;
break ;
}
}
return ( result ) ;
}
int i = GetValue<int>() ;
You can easily modify it to use Form rather than ValueType and make it more robust.
|
|
|
|