Why is the directory always on c:\ and named "test" ?

liunx

Guest
I use
Directory.CreateDirectory("test222")
to create a "test222" directory.
But it is always on c:\ and named "test". How can I create it on the current directory ?i think you should specify a path to it,
Dim path As String = "C:\Inetpub\wwwroot\yourSite\test222"
Directory.CreateDirectory(path)Here is my source code. The code will always create a directory on c:\test . Why can't I change it ?

<%@ Page Language="vb" %>
<%@ import Namespace="System.IO" %>
<script runat="server">

Sub Click2(Sender As Object, e As EventArgs)


Directory.CreateDirectory("c:\tttest")

End Sub

</script>
<html>
<head>
</head>
<body background="bg1.jpg">
<h1 align="center"><font face=? color=blue>sW?</font>
</h1>
<form runat="Server">
<table cellpadding="3" align="center">
<tbody>
<tr>
<td>
<span id="Span1" runat="Server"></span></td>
</tr>
<tr>
<td>
<img height="57" src=http://www.webdeveloper.com/forum/archive/index.php/"dir.gif" width="57" align="absBottom" /> s?W?G
<ASP:TextBox id="TB1" Runat="Server"></ASP:TextBox>
<ASP:Button id="Button1" onclick="Click2" Runat="Server" Text="Tw"></ASP:Button>
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>have you tried what i told you?! :confused:Yes, but it didn't work.your code wroks for me....
 
Back
Top