System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\maideen\Captures\CLPR-00138\0411'.

Last Reply on Jan 04, 2016 04:46 AM By Shashikant

Posted on Jan 04, 2016 04:45 AM

Mr.Mudassar

I used your code

Capture Image (Photo) from Web Camera (Webcam) in ASP.Net using C# and VB.Net

It works fine. Thank you. 

I am working in student management system creating student id

I need to change image name currently in date time

Dim imageName As String = DateTime.Now.ToString("dd-MM-yy hh-mm-ss")

I need the image name like "AL-00345/0615" based on student ID

and also appear the image path in text box or seesion in order to save into database.

Pls Help me.

Thank you.

Posted on Jan 04, 2016 04:46 AM Modified on on Jan 04, 2016 06:53 AM

Hi,

As we cant name file cotains  "/",we need to replace "/" with "-"(you can use your replaceable character) Please refer below code.

C#

string imageName = string.Format("{0}", studentId).Replace("/","-"); // Pass StudentId
string imagePath = string.Format("~/Captures/{0}.png", imageName);
txtPath.Text = imagePath;

VB

Dim imageName As String = String.Format("{0}", studentId).Replace("/", "-")
' Pass StudentId
Dim imagePath As String = String.Format("~/Captures/{0}.png", imageName)
txtPath.Text = imagePath

I hope this will help you out.