|
Depending on which browser you are using, you should be able to use the context or main menu to do a Save As operation.
|
|
|
|
|
thanks for reply!
but the page is Compeletly ajax,so i should scroll down and down to reload the info!
other website act same as this :
http://demos.9lessons.info/load_data_scroll.php[^]
i wanna do that in C#!
thanks in advanced!
modified 10-Aug-14 11:39am.
|
|
|
|
|
Sorry, but I'm not sure what your problem is in terms of C#.
|
|
|
|
|
Why should you get all the content of someone else's site? It's not yours! You should not touch it!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I am doing it for testing and get info of other website for some use!
|
|
|
|
|
In other words :
What's the best way to scrape a web page that has AJAX/dynamic loading of data?
For example: scraping a webpage that presents 20 images on load, but when a user scroll down the page it loads more images (sort of like Facebook). In such a case how do you scrape all the images, not just the first 20?
|
|
|
|
|
Use Fiddler (or something likewise) to see if it makes a specific call to fetch the data. You're looking for anything that gets loaded by the page using JavaScript and that returns some XML/JSON.
If that fails, then there's always the WebBrowser control
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am using this code in ASP.net :
<script type="text/javascript">
function getDataS() {
var dd = '{"jsonrpc":"2.0","method":"getPostList","id":1,"params":[1,[["place2",0,[1,1]]],173099135176724],"hash":"decfe7c9183f16efa1291f5131902f7d4ef4ff14"}';
$.ajax({
type: "POST",
url: "http://tehran.divar.ir/browse/json/?tm=1407824648578",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
crossDomain: true,
data: '{"jsonrpc":"2.0","method":"getPostList","id":1,"params":[1,[["place2",0,[1,1]]],173199866315710],"hash":"13210760e20de99b8218be5cc465851fcb6aa74a"}',
cache: false,
processData: false,
success: function(msg) {
if (msg.d != "")
alert('salam');
},
error: function(xhr, errorType, exception) {
var errorMessage = exception || xhr.statusText;
alert("There was an error creating your contact: " + errorMessage);
}
});
}
</script>
I get this error now :
There was an error creating your contact: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://tehran.divar.ir/'.
|
|
|
|
|
|
Now I process the data synchronized, when recieving the data it deal data.
But I found the data is high frequently recieved, And it waste too much time to process data.
So, I hope to process data asynchronous and ensure the data sequence, not to block the trecieve thread.
I read some arcitles, I get two methods:
1) when recieving data ,right now use " task.factory.startnew..."
2) when recieving data , "enqueue" the data to ConcurrentQueue, According to different data type, i use 8 queues. And the the program is started,
starting 8 threads to dequeue data for every ConcurrentQueue and process it.
public form1(){
Task.factory.startnew(()=>processData(1));
Task.factory.startnew(()=>processData(2));
Task.factory.startnew(()=>processData(3));
Task.factory.startnew(()=>processData(4));
Task.factory.startnew(()=>processData(5));
Task.factory.startnew(()=>processData(6));
Task.factory.startnew(()=>processData(7));
Task.factory.startnew(()=>processData(8));
}
void OndataReceive( string data){
if( ..){
queue1.Enqueue(data);
}
else if(...)
{
queue2.Enqueue(data);
}
....
retutn;
}
void processData(int queueID){
while(true){
ConcurrentQueue queue = getqueue(queueID)
for(int i =0; i < queue.Count; i++){
string s;
queue.TryDequeue(out s);
.....
}
Thread.Sleep(10);
}.
}
I test the above 2). I found CPU and the memory footprint is large ....
How should I solve this problem ?
Thanks
Andrew
modified 10-Aug-14 9:36am.
|
|
|
|
|
Peng2013 wrote: I found CPU and the memory footprint is large Creating a queue and eight threads doesn't hog my machine.
What code are you executing within that thread? Does it allocate memory? How big is the queue on a typical execution?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi All,
I face a problem when run my windows application at the first time( it is take a long time to load - up to 7 seconds) after that when i close it an open again it may take 2-3 seconds, I do some search and find the ngen.exe is the best solution.
Please let me know if the Ngen.exe the best solution or not, if yes how to use it in VS2010, if no what is the best solution.
Thanks All
|
|
|
|
|
NGen is about your only solution.
Everything else comes down to evaluating how you're written your application. For example, having 500 controls on a form is a really bad idea.
|
|
|
|
|
Hi,
The main form is the login form which contains the following controls:
1. 3 text box for login info as the following:
*. User Name text-box.
*. Domain text-box. (UserName= userLogin@Domain)
*. Password text-box.
2. Login button.
3. User Name Label.
4. Password Label.
5. Version Label.
And this form is take load time when open it in the first time.
Please Let me know how to use the NGEN.exe to solve this issue.
Thank You
|
|
|
|
|
This is normally done in your application installer. After your application is installed, you run NGEN on it to get the binaries built. This is normally an automatic option in modern installation builder tools like InstallShield and InnoSetup.
You're also going to improve performance by evaluating what your application is doing on startup, not just counting controls. What is going on in your Program.cs? What is going on in your Form.Load event? How big is your resulting executable when you compile it? Are you doing any database work? Are you using Entity Framework? There is a "warm-up" time when EF first starts.
Stuff like that...
|
|
|
|
|
ngen does help, I´ve used it in the past. However, make sure that your loadup isn´t taking unnecessarely long.
NGen is not a miracle thing and probably is more a workaround than a real solution.
Not sure if it exists still, but in winforms you could have a look at SuspendLayout, ResumeLayout.
Also, in our case a while back, the slow loading was due to thousands and thousands of records that had to be loaded in linked lists. When I convinced the client to change in a small way, the way they were working we could load each list on runtime when (and indeed if) the user needed it. The startup time changed from a few seconds to instantly.
Last thing is that you have to make sure the hardware is sufficient for that version of the .Net framework (and what the application is used for)
hope this helps.
|
|
|
|
|
Hi, this is sadish6 I want the algorithm for Multi-label Classifiers based Associative Classification (MCAC) in C# or VB.NET can any one please help me by providing the code
this link can be useful (https://www.dora.dmu.ac.uk/bitstream/handle/2086/10120/Neda-Thesis-FinalVersion.pdf?sequence=1)
someone with code please help me
Regards,
Sathish.
|
|
|
|
|
Oops you did not read the guidelines for these forums did you. We are not about supplying you code but helping YOU to code or learn to code.
You might try some of the various rent a coder sites they are into supplying code, for a price!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to VWorker.com and ask there.
But be aware: you get what you pay for. Pay peanuts, get monkeys.
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Greetings,
I currently worke on Programm working with the DevComponents.DotNetBar.DockingContainers, those Containers have a lot of functionality. My Problem is now, since i'm working with them as dynamic objects, e.g. a new usercontrol Needs to be shown -> Check if a DockingContainer is empty -> if not create one and put the uc in the new Container, i get several issues that i'm not able to solve.
1. The DockingContainers get deleted from time to time, e.g. uc is not needed anymore -> dispose it and delete the Container.
In this case my dockSite gets shrunk by the amount the Container was.
I have a "Workaround" for that but ist not satisfying as the other Containers are flashing while i resize.
Code for delete given:
/// <summary>
/// Deletes the container.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
/// <exception cref="System.NotImplementedException">Something went terribly wrong</exception>
private void DeleteContainer(object sender, EventArgs e)
{
DockContainerItem _tmp = (DockContainerItem)_currentClickedBar.Items[0];
PanelDockContainer _tmpPanel = (PanelDockContainer)_tmp.Control;
if (_tmpPanel.Controls.Count != 0)
{
...
}
else
{
_dockingPanels.Remove(_dockingPanels.Find(dp => dp.Name == _tmpPanel.Name));
_dockingContainers.Remove(_dockingContainers.Find(dc => dc.Name == _tmp.Name));
_barContainer.Remove(_barContainer.Find(bc => bc.Name == _currentClickedBar.Name));
DockSite _ds = (DockSite)_currentClickedBar.DockedSite;
int _width = _currentClickedBar.Size.Width;
int _height = _currentClickedBar.Size.Height;
dotNetBarManager1.Bars.Remove(_currentClickedBar);
_ds.Size = new System.Drawing.Size(_ds.Size.Width + _width, _ds.Size.Height + _height);
_currentClickedBar = null;
}
}
*EDIT*
2. Another Problem i have is that if i undock a Container, dock it into another one everything gets pretty messed up as i can't undock it out of the Container again and the old one stays inoperable for some reason.
It wasn't inoperable, i just messed up the Text property of the DockingContainerItem, therefore i couldn't see it in the "Tabs"
/SOLVED/
*EDIT OFF*
Here the other code for my Containers:
Creation:
/// <summary>
/// Creates the named docking container.
/// </summary>
/// <param name="NameContainer">The name container.</param>
/// <param name="NameBar">The name bar.</param>
/// <param name="NamePanel">The name panel.</param>
public void CreateNamedDockingContainer(string NameContainer, string NameBar, string NamePanel)
{
Bar newBar = new Bar("neuer Container");
newBar.Name = NameBar;
newBar.LayoutType = eLayoutType.DockContainer;
newBar.GrabHandleStyle = eGrabHandleStyle.Caption;
newBar.Stretch = true;
newBar.CanCustomize = false;
newBar.CanAutoHide = false;
newBar.MouseClick += bar_Click;
newBar.BarUndock += barContainer_BarUndock;
_barContainer.Add(newBar);
DockContainerItem tempDock = new DockContainerItem();
tempDock.Name = NameContainer;
_dockingContainers.Add(tempDock);
PanelDockContainer tempPanel = new PanelDockContainer();
tempPanel.Name = NamePanel;
_dockingPanels.Add(tempPanel);
tempPanel.MouseClick += panelDockContainer_Click;
tempDock.Control = new Control();
tempDock.Control = tempPanel;
newBar.Items.Add(tempDock);
dotNetBarManager1.Bars.Add(newBar);
dotNetBarManager1.LeftDockSite.GetDocumentUIManager().Dock(newBar);
}
Any help or experience with those DockingContainers would be appretiated
C# / VS2013
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
There's little response here, it seems. Try the DevExpress forum. It's a paid product with support.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
After you assign the DataSource to the Report, I want to assign to the label, textbox, xrTableCell1,... Report should I do? or I want to DataBinding, currently running it does not appear at all records
XtraReport1 report = new XtraReport1(); string sql = "select * from Customers";
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sql, cnn);
da.Fill(ds);
report.DataSource = ds;
report.DataAdapter = da;
report.DataMember = Customers;
report.ShowPreview();
|
|
|
|
|
What is Managed and Unmanaged code...???
|
|
|
|
|
|
If you Google "What is Managed and Unmanaged code" you get about half a million results - the first four look immediately helpful.
If you are having a specific problem understanding what you have found so far - can you ask about that? At the moment it looks like you want a packaged answer without having done any basic research.
Alberto Brandolini: The amount of energy necessary to refute bullshit is an order of magnitude bigger than to produce it.
|
|
|
|