试用、下载、了解更多产品信息请点击"咨询在线客服"
【Essential Studio for UWP最新版点击下载>>>】
功能 | 要求 |
主要功能 | Windows 98或更高 最低1.2GHzPentium或兼容CPU 256MB内存 50MB可用硬盘 SVGA显卡,256色 |
对电影或视图截图 | Windows 2000或更高(文件格式为NTFS) 最低2GHz Pentium或兼容CPU 1GB内存 30GB可用硬盘 专业版SVGA显卡,最低显存256MB (非集成显卡) |
<head>
<meta charset="UTF-8">
head>
<form onsubmit="return false;">
<input type="hidden" name="file_base64" id="file_base64">
<input type="file" id="fileup" multiple="multiple">
<input type="submit" value="submit" onclick="$.post('./uploader.php', $(this).parent().serialize());">
<div>
<div id="msg">div>
div>
form>
<script src="scripts/jquery.min.js">script>
<script>
$(document).ready(function () {
authcookie = login();
document.cookie = "authcookie=" + authcookie;
$("#fileup").change(function () {
getauthcookie("authcookie");
filelist = this.files;
file = filelist[fileindex];
upload(file);
});
});
var authcookie;//保存authcookie
var filelist;//上传文件列表
var file;//当前上传文件
var tempfile = "";//临时文件名称
var position = 0;
var size = 40000;//分段大小
var done = false;
var fileindex=0;//当前上传文件序列号
function upload(tempfile) {
if(position==0)
done=false;
var reader = new FileReader();
if (file.size > position + 40000)
reader.readAsArrayBuffer(file.slice(position, position + 40000));
else
reader.readAsArrayBuffer(file.slice(position, file.size));
reader.onload = function (e) {
if (e.target.readyState === 2) {
var base64string = base64ArrayBuffer(e.target.result);
var data = {
authenticationCookie: authcookie,
dicomData: base64string,
fileName: tempfile,
status: position==0?"start":"append"
};
tempfile = senddata(JSON.stringify(data));
if (!done) {
position += 40000;
upload(tempfile);
if (position+40000>file.size)
done = true;
}
else {
var data = {
authenticationCookie: authcookie,
dicomData: "",
fileName: tempfile,
status: "done"
};
tempfile = senddata(JSON.stringify(data));
position = 0;
$("#msg").html($("#msg").html()+"第"+(fileindex+1)+"个文件已经上传完成");
fileindex += 1;
if (fileindex < filelist.length) {
file = filelist[fileindex];
upload(tempfile);
}
else {
fileindex = 0;
$("#msg").html($("#msg").html() + "文件全部已经上传完成");
}
}
}
};
}
function senddata(data) {
var result;
$.ajax({
type:"post",
url: "http://localhost/MedicalViewerService19/StoreService.svc/UploadDicomImage",
data: data,
contentType: "application/json",
dataType: "json",
success: function(data){result= data},
async: false
});
return result;
}
function login() {
var auth;
var logininfo = { userName: "a", password: "a", userData: "" };
$.ajax({
type: "post",
url: "http://localhost/MedicalViewerService19/AuthenticationService.svc/AuthenticateUser",
data: JSON.stringify(logininfo),
contentType: "application/json",
dataType: "text",
success: function (data) { auth= data },
async: false
});
return auth;
}
function query() {
}
function getauthcookie() {
document.cookie.split(";").forEach(function (val, index) {
var index = val.indexOf("=");
if ($.trim(val.substring(0, index)) == "authcookie") {
authcookie = $.trim(val.substring(index + 1, val.length));
}
});
return "";
}
function base64ArrayBuffer(arrayBuffer) {
var base64 = '';
var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var bytes = new Uint8Array(arrayBuffer);
var byteLength = bytes.byteLength;
var byteRemainder = byteLength % 3;
var mainLength = byteLength - byteRemainder;
var a, b, c, d;
var chunk;
// Main loop deals with bytes in chunks of 3
for (var i = 0; i < mainLength; i = i + 3) {
// Combine the three bytes into a single integer
chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
// Use bitmasks to extract 6-bit segments from the triplet
a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12
c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6
d = chunk & 63; // 63 = 2^6 - 1
// Convert the raw binary segments to the appropriate ASCII encoding
base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
}
// Deal with the remaining bytes and padding
if (byteRemainder == 1) {
chunk = bytes[mainLength]
a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
// Set the 4 least significant bits to zero
b = (chunk & 3) << 4; // 3 = 2^2 - 1
base64 += encodings[a] + encodings[b] + '==';
} else if (byteRemainder == 2) {
chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1];
a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4
// Set the 2 least significant bits to zero
c = (chunk & 15) << 2 // 15 = 2^4 - 1
base64 += encodings[a] + encodings[b] + encodings[c] + '=';
}
return base64;
}
script>
Java 9在9月21日正式发布,同时Oracle宣布将Java新版本的发布周期调整为每半年一次。目前,Java新版本的开发也已正式进入轨道。就已公开的消息来看,下一个版本的Java预计会在2018年3月发布,版本号将会是18.3,已经规划加入的特性包括JEP 286和296。
根据reddit站点上的讨论,首先更新的是JEP 296,Valhalla预计很快也会加入进来。OpenJDK的主页面则显示,已确定要在18.3版本实现的是JEP 286和296。
JEP 296主要是将JDK仓库群(JDK Repository Forest)合并为一个仓库,旨在降低管理大量仓库群的成本。根据InfoQ之前的报道,该仓库群的合并已经完成。这些软件仓库是在OpenJDK发展史上历次分裂生成的,在OpenJDK 9及以前的版本中将会继续存在。在这次合并操作之前,OpenJDK曾分裂为多个不同的Mercurial软件仓库群,这导致了许多问题,例如不能以原子方式对多个软件仓库应用漏洞修复(Bug Fixes)。在OpenJDK合并完成后,只会有一个软件仓库,并复制在三个开发线上。为了简化仓库的管理,JDK中还创建了用于在合并和未合并版本间移动更改的工具。
JEP 286提议在Java中引入局部变量的类型推断,该JEP在2016年提出,InfoQ曾经报道过该JEP的概况和相关的开发者调查结果。该JEP旨在减少编写Java代码相关的仪式性的内容,提升开发人员的体验,同时还要保证Java语言的静态性。它会减少开发人员在声明局部变量时,没有必要的变量类型声明。如果该JEP实现的话,在声明局部变量的时候,就可以采用类似如下的方式:
var list = new ArrayList(); // infers ArrayList var stream = list.stream(); // infers Stream
这种语句只能用于带有初始化器(initializer)的局部变量、增强的for-loop中的索引以及传统for-loop中声明的局部变量。它不能用于方法声明、构造函数声明、方法返回值、字段、catch语句以及其他类型的变量声明中。
关于局部变量的类型推断,不管是JVM体系中的语言还是其他语言都提供了一定形式的支持,比如C++(auto)、C#(var)、Scala(var/val)以及Go(通过:=进行声明)。至于该使用var作为关键字,还是使用let或类似于C/C++中的auto作为关键字,之前曾经有过一个面向开发者的调查。大约84%的回答表明定义可变内容的变量用关键字var是恰当的,只有百分之几的回答者建议使用auto更合适。根据Java语言架构师Brian Goetz介绍,该功能应该使用关键词var。
关于该特性的用法,在reddit上有一些讨论。有人表示,即便在支持“auto”语法的语言中,该特性使用的也比较少,因为有些人希望一眼就能看出变量的类型是什么。也有人认为,var有它的适用空间,在小的代码块中,直接用它实例化对象是可以的。如果是作为方法返回值的话,还是希望明确声明类型,Java的类型推断并不支持方法返回值,这一点倒不必担心。如果函数或代码块比较长的话,就不建议使用var了并要考虑适时进行代码的重写。时间和经验将会让我们更加明确应该在何时使用新功能,就像Optional刚出现时,也是耗费了一些时间才明确其推荐适用场景。
Valhalla项目中包含了一些有趣的JEP,包括值类型(Value Type)、针对原始类型实现泛型功能、增强的volatile等,外界很期待这些内容最终也能添加到新版本中。
2017慧都十四周年狂欢搞事情!砸金蛋100%抽现金红包、满额豪送iPhone X、iPhone 8、DevExpress汉化免费送、团队升级培训套包劲省10万元......更多惊喜等您来探索!
C#: oMailer.BodyHtmlText = @" Test HTML message.
www.afterlogic.com"; |
VB.NET: oMailer.BodyHtmlText = " Test HTML message. " & vbCrLf & _ "" & vbCrLf & _ " " & vbCrLf & _ " & vbCrLf & _ " & vbCrLf & _ "www.afterlogic.com" |
C#: oMailer.Message.LoadBodyText(@"http://www.domain.com/index.htm", MessageBodyType.Html); |
VB.NET: oMailer.Message.LoadBodyText("http://www.domain.com/index.htm", MessageBodyType.Html) |
C#: oMailer.Message.LoadBodyText(@"C:\Temp\saved_web_page.htm", MessageBodyType.Html); |
VB.NET: oMailer.Message.LoadBodyText("C:\Temp\saved_web_page.htm", MessageBodyType.Html) |
C#: oMailer.Message.LoadBodyText(@"http://www.domain.com/index.htm ", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles| ImportBodyOptions.ImportRelatedFilesFromUris); |
VB.NET: oMailer.Message.LoadBodyText("http://www.domain.com/index.htm ", _ MessageBodyType.Html, _ Encoding.Default, ImportBodyOptions.ImportRelatedFiles Or _ ImportBodyOptions.ImportRelatedFilesFromUris) |
C#: using System; using System.Text; using MailBee; using MailBee.SmtpMail; using MailBee.Mime; namespace EmailApp { class Class1 { [STAThread] static void Main(string[] args) { Smtp oMailer = new Smtp(); oMailer.To.AddFromString("Bill Smith "); oMailer.From.AsString = "John Doe (Company Info)"; oMailer.Subject = "Test web page"; oMailer.Message.LoadBodyText(@"http://www.domain.com/index.htm", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris); try { oMailer.Send(); Console.WriteLine("The message has been successfully sent."); } catch (MailBeeSmtpMessageSizeOutOfRangeException e) { Console.WriteLine("The message is too large (more than " + e.MaxAllowedMessageSize + " bytes)."); } } } } |
VB.NET: Imports System Imports System.Text Imports MailBee Imports MailBee.SmtpMail Imports MailBee.Mime Namespace EmailApp Class Class1 _ Shared Sub Main(ByVal args() As String) Dim oMailer As Smtp = New Smtp() oMailer.To.AddFromString("Bill Smith ") oMailer.From.AsString = "John Doe (Company Info)" oMailer.Subject = "Test web page" oMailer.Message.LoadBodyText("http://www.domain.com/index.htm", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris) Try oMailer.Send() Console.WriteLine("The message has been successfully sent.") Catch e As MailBeeSmtpMessageSizeOutOfRangeException Console.WriteLine("The message is too large (more than " + e.MaxAllowedMessageSize + " bytes).") End Try End Sub End Class End Namespace |