C语言或者C++如何调用一个http接口并得到返回结果?

Python013

C语言或者C++如何调用一个http接口并得到返回结果?,第1张

用jni

首先

java

public

class

testhello

{

static

{

system.loadlibrary("testhellos")

}

public

static

native

void

hello(string

msg)

public

native

void

getsysid()

public

native

string

getkeycode(string

sysid)

public

native

boolean

testkeycode(string

sysid,

string

keycode)

public

static

void

main(string[]

args)

{

//

hello("hello,kimm!")

testhello

t=

new

testhello()

t.getsysid()

}

}

用javac

testhello.java,

java

testhello,javah

-classpath

.

-verbose

testhello

。将生产的头文件用到c++

中的

heardfileds

中。然后在

sources

files

中实现

heardfieds

的方法。实现的方法,其实就是你要调用c++的方法、

用c语言实现文件自动下载并且解压1.自动下载 http://abc.com/test.rar 也可以下载FTP://abc.com/test.rar2.下载完成后自动解压到本路径下相同的文件夹里面,如:test.rar就是test文件夹3.如果test文件夹已经存在并且里面有内容就直接覆盖4.软件运行的时候提示用户输入存储路径5.下载过程中显示下载进度6.一个好的编程会在适当的地方加上适当的注释以上功能我已经用wget+winrar的做成批处理可以运行了,但是希望用C语言来实现先送50分,如果实现了在加送50分,不希望吧分数留给系统

希望采纳

去看一下《Advanced Linux Programming》这本书吧,第11章讲的就是怎么用C语言实现一Http服务器。 这里有下载地址(英文的): http://www.advancedlinuxprogramming.com/alp-folder 英文看起来不顺的话可以上网找找有没有中文版的这本书,应该叫Linux高级编程吧~~~参考资料: http://www.advancedlinuxprogramming.com/alp-folder