如何从网址添加此代码的下载数据库文件代码?
=============================================== ==================== { * Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout(" lay1pezeshki&#34) Dim jobname As String
job.Initialize("downloadfile",Me)
timer1.Initi
alize("t1",2000)
timer1.Enabled=True
Dim ruta As String
If File.ExternalWritable Then
ruta = File.DirDefaultExternal
Else
ruta = File.DirInternal
End If
If File.Exists(ruta,"uromkartbank.db")Then
File.copy(File.DirAssets,"uromkartbank.db",ruta,"uromkartbank.db")
End If
sql1.Initialize(ruta,"uromkartbank.db",True)
Dim cur1 As Cursor
cur1 =sql1.ExecQuery("select * from پزشکی")
Dim i As Int
For i=0 To 10
cur1.Position = i
b = ListView1.TwoLinesLayout.SecondLabel
b.TextSize = 10
b.TextColor= Colors.Red
c = ListView1.TwoLinesLayout.Label
c.TextSize = 18
c.TextColor= Colors.White
ListView1.AddTwoLines(cur1.GetString("name") &("--------------")& cur1.GetString("takhfif"),cur1.GetString("addres"))
Next
End Sub*
}
答案 0 :(得分:0)
fileURL = "http://dl.dropbox.com/u/25045/file.jpg" 'File To Download
HttpUtils.CallbackActivity = "myactivity" 'Current activity name.
HttpUtils.CallbackJobDoneSub = "DownloadFinished"
HttpUtils.Download("Job1", fileURL)
Dim out As OutputStream
out = File.OpenOutput(File.DirInternal, "file.jpg", True)
File.Copy2(HttpUtils.GetInputStream(imgurl), out)
out.Close