.net - Unable To List File Or Directory Contents On ASP.NET Page Using Shared Drive?

Oct 27, 2011

In this question I'm using Visual Studio 2008. My code is quite simple, as it was used from a reference I grabbed off the web. I'm using ASP/VB.Net, IIS6.0 on a Windows Server 2003 box.I've looked at various sources online, and have not been able to piece together a proper result. The purpose of this is to list a slew of directories and their respective files, and allow the user to eventually manage that directory (such as open and delete files).

Here is my ASPX page:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DirectoryList.aspx.vb" Inherits="VCMReports.DirectoryList" %>
<!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" >

[code]....

When launching the page, the following error appears: 'V:Users' is not a valid virtual path. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: 'V:Users' is not a valid virtual path.

Things I have tried:

On the server, I have mapped out the drive and the directory.Permissions seem to be properly set, impersonate is correct.If I were to list a directory in the actual directory "C:InetpubDirectory", there is no failure.I do understand this is incomplete for the Directory listing portion, this will only list files (so this will need to be modified.I have attempted to create a Virtual Directory, and the application presented the same error. On my local development machine, I have the same path created - same error. How am I able to view the contents of a shared directory and it's files?

View 1 Replies


ADVERTISEMENT

Forms :: Determine A Dynamic Drive Letter For A Directory On The Removable Drive And Then Open That Directory In An Explorer Window

Feb 19, 2009

First off a short background of the project I am working on- I am developing a program that will be run off removable media (i.e. USB Flash drive). This will be a �virtual desktop� which you will be able to take with you and have the same �desktop� on any system. As we know drive letters can change with each host system the drive is plugged into, I need to be able to determine the path for the flash drive and access a specific folder ( i.e. My Documents)

I have an picture box(representing the icon) placed on my form (form1) and when I click the icon I want to be able to open and view the a specific folder from the portable drive. I need a click event that will determine a dynamic drive letter for a directory on the removable drive and then open that directory in an explorer window.

[Code]....

View 1 Replies

Can Insert A File Into A Shared Drive

Nov 15, 2010

We have a shared drive which has a folder in which we programatically store the reports we create in MS Access. Sometimes the user will lose the rights to insert the files in (write access) to that folder. But we are not shown any system generated error messages for this while adiing the reports. At a lter point of time we will come to know that those reports were not saved.I am looking for a code to check whether we have the write access to the particular folder and if not, throw a suitable error message.

View 3 Replies

File Copies From Shared Directory But Not Subfolders?

May 14, 2010

I got a file to copy using vb.net 2.0 from another server to a local folder:

dim source as string = "\servernameshared directoryindex.htm"
dim destination as string = "D:/local folder/index.htm"
system.io.file.copy(source, destination, true)

[code]......

View 6 Replies

Unable To Open File And Fill Collection With File Contents?

Apr 15, 2012

I have a Motor Class, along with a Collection to hold objects address. Each Collection object holds the Class fields as a String to display in list box. I am able to write the collection string to the file and save the string. But unable to open the existing file, read the file back into the collection object.

Public Class Motor
Private strId As String
Private strDescription As String

[Code]......

I have looked all over for anything (samples or tutorials for working with files and collection objects) pertaining to type of operation with out any success.

View 2 Replies

Unable To Run Batch File Located On Mapped Network Drive?

Nov 29, 2011

I am unable to run batch file that is located in mapped network drive using System.Diagnostics.Process in VB.Net. I get:'<batchfilename>.bat' is not recognized as an internal or external command, operable program or batch file.Press any key to continue..I get the same error when navigate to the folder (using explorer) that contains this batch file and double click it. I can successfully run the batch file by changing the directory to that folder through command prompt. I can't figure out why this is happening. I think the problem is Start() function of Process works like double click rather than just run the batch file.

[Code]...

View 1 Replies

.net - Getting The Contents Of Web Page And Processing It (Print Or Save To File)?

Nov 19, 2009

I am a Real Estate appraiser and have some limited experience with vb and .net. I have a task which I perform which requires me to go to the conuty appraisers web site and print a copy (to image bmp or jpg or directly to the default printer) of the current public record info for anywhere from a few pages to 1,000 plus records at a time.

I don't really get paid to do this part of the job so they don't care whether it takes me a few minutes or several hours to do this. I thought there must be a way to automate this process, so last week I started searching and test code snippets.What I have to date opens an instance of IE; navigates to the reguested page; finds the form elemet for AcctNo; fills it in and submits the form. The page that comes back is formatted for screen presentation and is not suitable to be sent to the printer. There is however a link which when clicked returns a page formatted for pinting. Downside is it also brings up the print dialog which then has to be handled. I was able through several methods to click either the print button or the cancel button which leaves me with a document that is either sent to printer or sitting on screen.

The questions are: Is there a way to do this without displaying the Print Dialog? Maybe a HTTPRequest or HTTPWebREquest as I have no need to see the screens just need the final page.The resultant page is typically longer then letter by a few lines and wants to print on two pages. It would be nice to resize the page to fit and typically it will be the same resizing. If I stick with the print dialog either clicking print or cancel how can I intercept the document and decide by options set in the program wheter to send the file to the printer or save to image?

View 4 Replies

VS 2010 Get A List Of Every Single File On The Root Drive?

Jun 28, 2011

I know, looping through is fast enough. But the search program "Everything" can index my entire C: drive in about 15 seconds. Does it read the MFT or something? Can I do this easily enough with VB.NET? Or at all?

View 5 Replies

.net - Copy Local Directory Contents To Another Directory

Oct 31, 2011

I have a straight-forward task I'm attempting to accomplish. I have the mechanics down, and need to hammer out the details but I'm stumbling across one small point. :)

This script is supposed to take the files in the local C:Temp directory, and copy them to a selected user's shared directory on the file server.

Protected Sub btnCopy_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCopy.Click
My.Computer.FileSystem.CopyDirectory("C:Temp", "\MAVERICKVOL1Users" & ddlName.SelectedValue & "DESKTOPRECORDINGS", True)
End Sub

This script does indeed work (and I'm aware I need to create exception handling) but it only copies what contents are on the server's directory of C:Temp rather than the local source directory.

I'm using VB.NET/ASP.NET to achieve this.

How am I able to direct my function to use the local user's directory rather than the remote server?

View 1 Replies

Select File From FTP Directory For Download On My Page

Jun 30, 2011

I am developing a website in ASP.Net and VB.Net to allow users to upload and download files from and to an FTP site and my desktop.

I have successfuly got the upload side working.

As far as the download part is concerned, I have so far got it so that when the user goes to the download page, the FTP file list appears so you can see the files that are currently residing on the FTP site.

I was wondering if there is a way that I can program my site so that the user can select one of the files and click on the 'Download' button that I have?

Here is my code so far:

CODE:

View 1 Replies

Copy Contents Of A List Box To A Text File?

Apr 21, 2010

I understand I've been asking alot of similar questions around this topic, but I think, with luck, and your help, this will be the last time.

I have a listbox containing x-many different values.

What I want the program to do is to overwrite a pre existing file with all these values,

that is, essentially, to do the reverse of this piece of [code]...

View 4 Replies

Wrtite The Contents Of A Text File To A List Box?

Jan 30, 2010

Im using visual basic 2009, im trying to wrtite the contents of a text file to a list box, im using the following format technique

{0, -5}{1, -20}{2, -20}{3, -5}{4, -5}{5, -5}{6, -5}{7, -20}

i have used a similar format in vb6 where it worked, but in .net it doesnt get me anywhere, does anyone have experience of using string format in vb.net and can help me? =]

View 1 Replies

Get Video Thumbnail From A Video File (from A Directory In Hard Drive)?

Jul 21, 2011

I would like to create thumbnails into a VB (2005 or 2010) form from video files.

I have a directory (in my hard drive) with video files (.mpg).

How to show video thumbnails for each video file?

My VB code (for images) is attached below and I want to convert it in order to manage video files.

Private Sub ThumbButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ThumbButton.Click
Dim imagepath As String

[Code].....

View 2 Replies

Deployment :: User Error When Writing To Shared Drive?

Feb 24, 2009

I have create a vb.net app that creates an excel spreadsheet. When I deployed the app, to the shared drive, I have no problems but the user gets the below error. The user can create the spreadsheet but gets the error when writing. When the user logs onto my PC, the user does not get the error. When I log onto the users PC, I got the error. Application attempted to perform an operation not allowed by the security policy To grant the application the required permission, cintact your local system adminsitrator, or use the Microsoft .net framework

request for the permission type 'System.security.permissions.securitypermissions mscorlib
version 2.0.0.0 culture =neutral
Publickeytoken='b77a5c56193e089'

I have tried to use caspol but it doesn't help?

View 1 Replies

Display Contents Of A Drive?

Jun 12, 2012

Is there a way to display the contents of a drive (C:/) in a way similar to that of windows - pretty much just like this[url]...

Except that i need to show the files and - this is the part i really have no clue on - using the icon maybe using the Icon.ExtractAssociatedIcon method ?

View 1 Replies

Write The Contents To A .txt File To Load Back Into The List Boxes

May 9, 2012

I have 4 list boxes and I am trying to write the contents to a .txt file to load back into the list boxes. I am having trouble with the code to write all the contents into the file. Should I make a file for every list box individually? Or just one file? Here is the code I have so far...

Private Sub SaveButton_Click(sender As System.Object, e As System.EventArgs) Handles SaveButton.Click
Dim FileString As String = "F:Microsoft Visual Studio 2010Advanced VBVB Auto

[Code].....

View 1 Replies

Validate The Contents Of A MaskTextBox With Contents From An Array Or List?

May 10, 2011

I am trying to create a code where I placed sets of numbers in an array.I'll use a masktextbox to have the user enter the numbers to match what's in the array. If the user enters the number, ex: social, and the data is correct (matches the numbers in the array), something happens if the number entered in the masktextbox does not match any of the number sets in an array then another thing happens.The masktextbox so far only validates format and gets number only, however, I want the number entered to match whats in the array.

View 1 Replies

HTML Of The Current Page In The Browser To End Up In A Text File In The Applications Own Directory

Mar 4, 2009

I am working on a project I have a form that contains a web browser and I want to write a function that will place the Source (HTML) of the page in a text file I have put some code together it doesn't throw up an error but at the same time doesn't work:

[Code]...

View 4 Replies

Copy Entire Contents Of USB Drive Using VB?

Jun 1, 2010

I am trying to copy the entire drive contents of a CF card to another location. For example:

Source Location:
e:DCIM
Destination Location:
X:2010-06-01

What I want to do:

- Copy E:*.* to Destination
- The original file structure can stay the same. I want to copy everything from the root of the Source Drive

I can copy the contents if I set source string to e:DCIM.. But I'm concerned that if I get something that doesn't have the first directory (DCIM) it's going to error.

View 4 Replies

C# - Allowing User To Save Contents Of Html List To Text File?

Dec 2, 2010

I'm working on an application (ASP.NET, Webforms) that generates a list of outputs based on a user input. I want to allow the user to save the contents of said list as text file, or possibly as other filetypes such as .csv.Can it be done client-side with Javascript?

View 2 Replies

.net - Get The Drive Letter Of CD Drive From List

Mar 12, 2011

I am using the following code to get a list of the letters for each drive on my computer. I want to get the drive letter of CD Drive from this list. The code I am using to get list is as below:

[Code]...

View 2 Replies

.net - List AD Groups With Access To A File Or Directory?

Jul 6, 2010

I'm writing code to parse through a list of file directories and identify which AD groups have access. That info is available in the operating system under the file properties security tab, but I can't find any code examples that retrieve that info in vb.net (or c#). Anyone have code that will do that?

View 1 Replies

VS 2008 Displays Contents Of A Certain Folder In Local Drive?

Apr 11, 2010

A form that will display the contents of a folder? I have my forms set up, I want the user to then click on a button that will load up a nw form which will contain a window that is a folder in one of my drives. There may be folders inside this main folder which the user can go into, but they can't go back frrom the original main folder and look at the other contents. First up, Is an explorer form the one I am looking for? Making one of those, it seems to be the right path but where to from there?

Another thing I need to be able to do is have the user double click on the files inside of the folder. When double clicked the folder still maintains its current state, as the files that will be clicked will do the work in the background. I have all the forms set up and linked together, I just need to know how to get this folder into a form..

View 13 Replies

Unable To Get Master Page Control's Value At First Page Load

May 21, 2012

I am using <%@ MasterType virtualpath="~/__.Master" %> to embed my master page content into child page to access control belong to Master Page. I have one DropDownList in Master page. And I want to access its SelectedValue in my Child Page.

Problem is when page first time loads and as I am trying to access DropDownList's Selected Value by writing in child Page - "Master.DropDownList.SelectedValue". I am not able to get DropDownList's Value. Its display's Blank.

But When Page.IsPostBack I am able to get SelectedValue of that DropDownList.

View 1 Replies

VS 2010 - List Of File Names From Selected Directory In ComboBox

Apr 10, 2012

I am trying to populate a combobox with a list of filenames from a selected directory. I am getting the directory OK but the combobox instead of having a list of 8 files max shown when I select the combobox has a full list of all the files selected from that directory.

Private Sub BrowseButton_Click(sender As System.Object, e As System.EventArgs) Handles BrowseButton.Click
If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
TextBox1.Text = FolderBrowserDialog1.SelectedPath
End If
[Code].....

View 8 Replies

How To Create A Directory In Drive C

Apr 27, 2010

i am trying to create a directory in drive C: (at a win7 target machine) withirectory.CreateDirectory but so far no luck.I believe the problem has to do something with permissions-security... So here i am..

View 3 Replies

Get Name Of A Shared Directory On A Local Machine?

Apr 12, 2010

I see several posts about getting the UNC of a remote drive, anyone have any ideas how I get the name of a shared directory on a local machine?

View 1 Replies

Looping Through All Directory's On Hard Drive

Oct 6, 2010

[code] i need to find a way to loop through ALL the directory's on the "c" drive and not just the main folder.

View 4 Replies

Looping Through All Directory's On The Hard Drive

Oct 6, 2010

i have this piece of code:

[Code]....

and it works just fine. However, saying that, i need to find a way to loop through ALL the directory's on the "c" drive and not just the main folder. Does anyone have any code that can do that?

View 2 Replies

Looping Through All Directory's On The Hard Drive?

Mar 9, 2012

have this piece of code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strFileSize As String = ""

[code].....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved