如何在C#中从imdb获取电影信息 [英] How to get movie information from imdb in C#

查看:107
本文介绍了如何在C#中从imdb获取电影信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个电影库软件,它有一些文本框。现在我想知道如何从互联网(任何网站 - 如Imdb)获取信息,并填写该信息的文本框?例如,我现在有一个名为Year的标签盒,当我搜索像战斗俱乐部一样的电影名称时,它应该从Imdb或谷歌获得年份并在年份文本框中写入。非常感谢你。



我尝试过:



i search在谷歌上找到omdb api但我不知道如何使用它。我是C#的新手。

Hi, I'm creating a movie library software, it has some text boxes. now I want to know how to get information from internet (any site - like Imdb) and fill that text box with that info? For example, I have a label box named Year now when I search a movie name like fight club it should get the year from Imdb or google and write it in the Year text box. Thank you so much.

What I have tried:

i search on google and find omdb api but i don't know how to use it. i'm new to C#.

推荐答案

使用ombdp api的用法和参数位于 OMDb API - 开放电影数据库 [ ^ ]。



如果你想使用其他网站,看看他们是否有api,否则你必须手动解析html,这可能是不可行的。



只需一点谷歌搜索就可以获得很多例子。比如这个, Imdb服务 - 主页 [ ^ ]
The usage and parameters to use ombdp api are at OMDb API - The Open Movie Database[^].

If you want to use other sites, see if they have an api otherwise you have to parse the html manually, which likely would not be feasible.

And just a little bit of googling will get you lots of examples. Such as this one, Imdb Services - Home[^]


我写的是类似的东西,找到了 TMDB [ ^ ] API非常好。它很容易访问,与Imdb Web服务不同,完全免费。



干杯,



Mick
I am writing something similar, and have found the TMDB[^] API very good. It is simple to access, and unlike the Imdb web service, totally free.

Cheers,

Mick


这不是直接与C#有关。



您已经找到了OMDB API的解决方案。



只需使用Web服务方法即可获得以JSON或XML格式输出



成功搜索泰坦尼克号电影



这将以JSON格式提供有效输出。虽然输入不正确的年份,但是下面的一个会给出错误。



搜索泰坦尼克号电影失败
This is directly not related to C#.

You had already finded the solution that is OMDB API.

Just use web service methods and get output in JSON or XML Format

Success Search Titanic Movie

This will give valid output in JSON format. While below one will give wrong as incorrect year is entered.

Failed Search Titanic Movie


这篇关于如何在C#中从imdb获取电影信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆