<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function browseFolder(path)
{
try
{
var Message = "\u8bf7\u9009\u62e9\u6587\u4ef6\u5939"; //选择框提示信息
var Shell = new ActiveXObject("Shell.Application");
var Folder = Shell.BrowseForFolder(0, Message, 64, 17);
if (Folder != null)
{
Folder = Folder.items();
Folder = Folder.item();
Folder = Folder.Path;
if (Folder.charAt(Folder.length - 1) != "\\")
{
Folder = Folder + "\\";
}
document.getElementById(path).value=Folder;
return Folder;
}
}
catch(e)
{
alert(e.message);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" οnclick="browseFolder('txtRTFPath')" value="Browse..." />
<asp:TextBox ID="txtRTFPath" runat="server" Width="200px"></asp:TextBox>
</div>
</form>
</body>
</html>