我使用以下代码拖放单个文件.
private void FormRegion2_DragEnter_1(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{ e.Effect = DragDropEffects.Copy; }
// or this tells us if it is an Outlook attachment drop
else if (e.Data.GetDataPresent("FileGroupDescriptor"))
{ e.Effect = DragDropEffects.Copy; }
// or none of the above
else
{ e.Effect = DragDropEffects.None; }
}
private void FormRegion2_DragDrop_1(object sender, DragEventArgs e)
{
string[] fileNames = null;
if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
{
fileNames = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string fileName in fileNames)
{
}
}
else if (e.Data.GetDataPresent("FileGroupDescriptor"))
{ …Run Code Online (Sandbox Code Playgroud) 我试图使用以下代码计算给定字符串中的单词数:
var t = document.getElementById('MSO_ContentTable').textContent;
if (t == undefined) {
var total = document.getElementById('MSO_ContentTable').innerText;
} else {
var total = document.getElementById('MSO_ContentTable').textContent;
}
countTotal = cword(total);
function cword(w) {
var count = 0;
var words = w.split(" ");
for (i = 0; i < words.length; i++) {
// inner loop -- do the count
if (words[i] != "") {
count += 1;
}
}
return (count);
}
Run Code Online (Sandbox Code Playgroud)
在该代码中,我从div标签获取数据并将其发送到cword()函数进行计数.虽然IE和Firefox的返回值不同.正则表达式中是否需要进行任何更改?有一件事我表明两个浏览器发送相同的字符串在cword()函数内部存在问题.
var objWeb = properties.Feature.Parent as SPWeb;
SPContentType contentType = objWeb.ContentTypes["Wiki Page"];
if (!contentType.Fields.ContainsField("Keywords"))
{
SPField field = objWeb.Fields["Keywords"];
SPFieldLink fieldLink = new SPFieldLink(field);
contentType.FieldLinks.Add(fieldLink);
contentType.Update(true);
}
Run Code Online (Sandbox Code Playgroud)
我在功能激活中使用此代码将站点列"KeyWord"添加到站点内容类型"Wiki Page"我的问题是"关键字"添加到"wiki页面"但不是从现有站点列添加新站点列.我的代码有问题吗?
另外一件事,当我在office365上部署这个问题时,我的MOSS服务器上的这个代码工作得很好
我在JavaScript中使用split函数.它在Firefox和Chrome中运行良好,但是当我调用split函数时IE显示错误.有没有办法使用像split这样的其他功能?
我想将word文档转换为pdf.
我找到了很多使用office dll的解决方案.但我想要一个使用免费第三方DLL的解决方案,因为在办公室dll必须安装办公室.所以在我的服务器上安装了办公室.
有免费的第三方dll ???
寻找一个CSS属性,它将在所有浏览器上运行,其中word的条件如下.1.单词不应该破解.2. href链接文本应该在html标记内中断.连字符文字不应该破解.4.内容可以是DIV,跨度或具有多行的标签.
c# ×2
javascript ×2
.net ×1
asp.net ×1
c#-4.0 ×1
css ×1
css3 ×1
firefox3.5 ×1
html ×1
html5 ×1
ms-word ×1
outlook-2010 ×1
pdf ×1