老师为了能调相机和相册,我整了两天差不多可以了
1\这个页面有mui.init()初始,但点手机返回键要退出,只有点顶部返回可以,其他页面有这个可以,另外这个在本机网页中查看不到源代码,其他可以,懂不起什么原因,请帮指导下
Dim e As RequestEventArgs = args(0)
Dim sb As New StringBuilder
sb.AppendLine("<meta charset='utf-8'>")
sb.AppendLine("<meta name='viewport' c />")
sb.AppendLine("<script src='../mui/js/mui.min.js'></script>")
sb.AppendLine("<link href='../mui/css/mui.css' rel='stylesheet'/>")
sb.AppendLine("<script Type='text/javascript' charset='utf-8'>mui.init();</script>")
sb.AppendLine("<header style='height:60px;background:#EEEEE0' class='mui-bar mui-bar-nav mui-bar-nav-bg'>")
sb.AppendLine("<a style ='line-height:40px;' id='icon-menu' class='mui-action-back mui-icon mui-icon-left-nav mui-pull-left'></a>")
sb.AppendLine("<script type='text/javascript' src='../mui/js/camera.js'></script>")
sb.AppendLine("<script type='text/javascript' src='../mui/js/common.js'></script>")
sb.AppendLine("<form method='post' enctype='multipart/form-data' id='form1' name ='form1' action ='submit.htm'>")
If FileSys.FileExists("c:\web\xp\" & e.Cookies("username") & ".jpg")=True
sb.AppendLine("<a class='mui-icon mui-pull-right mui-a-color'><div style='width: 40px; height: 40px; float:left; border-radius: 50%; border: 1px solid #eee; overflow: hidden;'><img src='./xp/" & e.Cookies("username") & ".jpg' width='40' height='40' /></div></a>")
Else
If ReadSex(e.Cookies("username"))= "女"
sb.AppendLine("<a class='mui-icon mui-pull-right mui-a-color'><div style='width: 40px; height: 40px; float:left; border-radius: 50%; border: 1px solid #eee; overflow: hidden;'><img src='./xp/tx2.jpg' width='40' height='40' /></div></a>")
End If
If ReadSex(e.Cookies("username"))= "男"
sb.AppendLine("<a class='mui-icon mui-pull-right mui-a-color'><div style='width: 40px; height: 40px; float:left; border-radius: 50%; border: 1px solid #eee; overflow: hidden;'><img src='./xp/tx1.jpg' width='40' height='40' /></div></a>")
End If
End If
sb.AppendLine("<h1 style ='line-height:60px;' class='mui-title'>我的相片</h1>")
sb.AppendLine("</header>")
sb.AppendLine("<div class='mui-content'>")
If ReadSex(e.Cookies("username"))= "女"
sb.AppendLine("<div style='height: 180px;border:1px solid red; width:50%'><img src='./xp/yb.jpg' style='height:180px;width:140px;max-height:100%;'></div>")
End If
If ReadSex(e.Cookies("username"))= "男"
sb.AppendLine("<div style='display:table-cell;text-align:center;vertical=align:middle;height: 180px; width:50%;margin-top:80px;float:left'><img src='./xp/yb1.jpg' style='height:180px;width:140px;max-height:100%;'></img></div>")
End If
If FileSys.FileExists("c:\web\xp\" & e.Cookies("username") & ".jpg")=True
sb.AppendLine("<div id ='imgs' style='display:table-cell;text-align:center;vertical=align:middle;height: 180px; width:50%;margin-top:80px;float:left'><img style='width:140px;height:180px;' src='./xp/" & e.Cookies("username") & ".jpg'></div>")
Else
sb.AppendLine("<div id ='imgs' style='display:table-cell;text-align:center;vertical=align:middle;height: 180px; width:50%;margin-top:80px;float:right'><img style='width:140px;height:180px;' src='./xp/wxp.jpg'></div>")
End If
sb.AppendLine("<button id='btn1' name='btn1' type= 'button' onclick=getImageByCamera('imgs') style='position: fixed;left:60px; bottom:10px;z-index:5;height:35px;width:33%;border-radius:20px;line-height:35px;color:white;background-color:dodgerblue'>相机</button>")
sb.AppendLine("<button id='btn2' name='btn2' type ='button' onclick=galleryImg('imgs') style='position: fixed;right:60px; bottom:10px;z-index:5;height:35px;width:33%;border-radius:20px;line-height:35px;color:white;background-color:dodgerblue'>相册</button>")
sb.AppendLine("<button id='btn3' name='btn3' type ='sumbit' style='position: fixed;right:60px; bottom:50px;z-index:5;height:35px;width:33%;border-radius:20px;line-height:35px;color:white;background-color:dodgerblue'>确定</button>")
e.WriteString(sb.Tostring)
e.Handled= True
2、这个保存图片函数怎样改才行,不得行,谢谢
Dim e As RequestEventArgs = args(0)
For Each key As String In e.Files.Keys
For Each fln As String In e.Files(key)
If FLN>""
Dim ifo As new FileInfo(fln)
If key ="imgs"
e.SaveFile(key,fln,"c:\web\xp\" & e.Cookies("username") & Ifo.Extension ) '保存接收到的文件
End If
End If
Next
Next
e.WriteString("OK")
e.Handled=True
[此贴子已经被作者于2020/3/25 23:07:08编辑过]