简体   繁体   English

如何在C#中从网页源获取图像源

[英]How to get a image source from a webpage's source in C#

I am trying to make a program easy enough my co-workers can use it. 我正在努力使我的同事可以轻松使用该程序。 The program takes the inputted image ID number, adds it to the static link, and downloads the image. 程序获取输入的图像ID号,将其添加到静态链接,然后下载图像。 The problem is to get the image ID you have to view the pages source code. 问题是获取您必须查看页面源代码的图像ID。 Is there a way I can have it so I input the document number / link and it automatically gets the image source from the webpage's source? 有什么办法可以让我输入文档编号/链接,它会自动从网页来源获取图像来源?

If you need to look at an example, here is a random example document: http://ori2.polk-county.net/wb_or1/details.asp?doc_id=7029941&file_num=2008093164 如果您需要查看示例,请参阅以下随机示例文档: http : //ori2.polk-county.net/wb_or1/details.asp?doc_id=7029941&file_num=2008093164

Also, I am using C# 另外,我正在使用C#

Assuming that your documents are all accessed through the same URL .http://ori2.polk-county.net/wb_or1/details.asp 假设所有文档都通过相同的URL访问。http://ori2.polk-county.net/wb_or1/details.asp

You can use the WebRequest class to POST your doc_id and file_num. 您可以使用WebRequest类来发布您的doc_id和file_num。 You should then receive the image in the response. 然后,您应该在响应中收到图像。

This is a good place to start 这是一个很好的起点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM