Web Forms :: Get Users Local System Drives

Jan 23, 2012

getting user's local machine drives in asp.net

When i use the code below

foreach (DriveInfo drive in DriveInfo.GetDrives())

{       Console.WriteLine(drive.Name);}

after deploying in server it get servers local drives

View 1 Replies


Similar Messages:

Web Forms :: Get Image Placed In Local System Path?

Feb 28, 2011

I have a image control in my page.I will get the path dynamically like c:/localBracodeimage/barcode123.jpg. i gave the path to my image control like

imgBarcode.ImageUrl = c:/localBracodeimage/barcode123.jpg.

at runtime its not displaying...My application was published in IIS.

View 3 Replies

Web Forms :: Attach The Image - Users Browse The File From The Local Computers And Send It

Feb 9, 2011

I have created a form and it works. But on the form I want to let users browse the file from the local computers and send it to us.

View 2 Replies

Web Forms :: File Size Saved On Local System Is Not Same As The Server?

Mar 6, 2010

i have file

Response.Clear()
Response.ContentType =
"application/octet-stream"
Response.AddHeader(Response.WriteFile(M_FILENAMe, "Content-Disposition", _"attachment; filename=""" & M_FILENAMe & """")True)Response.Flush()
Response.End()

the file is being saved on the server & needs to be same on the local system too so used the above code but the actual size is nt being saved on the local system if the file size on server is 3 MB in local system i gets saved in kbs

View 3 Replies

Web Forms :: Showing All Drives Of Dev Server?

Aug 5, 2010

I have implemented this in my website as per my requirement. [URL] It is working fine in local. But i moved that code to dev server today... it is showing all the drives of dev server. (But my fuctionality is it should show all the drives of local computer who is accessing this ste).

View 1 Replies

Web Forms :: Creating Windows Service In Local System To Access DB In Hosted Server

Feb 8, 2013

Created a windows service for my local system for sending bulk mail and it is working.But the same if the want to access the db which is there in hosted server and want to install it in my local machine to access the db details from the server , is not working. While starting a service , it is stopping immediately. Is it possible to do so?

View 1 Replies

Why .NET Refrence To Local PC In Users Event Log

Feb 28, 2010

A customer has sent my a screen shot of their event log which shows an error from my ASP.Net app, the problem is it shows the line number where the error occurred but references my PC and the path into my files. Why? There's no references in my code

View 2 Replies

Web Forms :: Securely Access Server Drives And Folders

Nov 22, 2015

I have M:PDF-ImagesList-PDF drive on the Server with thousands of images stored.

On the M drive has folder:

M:PDF-ImagesList-PDF45404539532.pdf
4539533.pdf
4539534.pdf
4539537.pdf ...

How to access to the folder drive by using VB.NET or C# in the code-behind (securely: with username and password) for the users to be able to view images on the popup window?

See the code :

Protected Sub BtnServerDrive_Click(sender As Object, e As EventArgs) Handles BtnServerDrive.Click
Dim PartNumber As String = txtPartNumber.Text.Trim()
'Calculate the folder 4540 like container
Dim NumContainer as string = txtPartNumber.Text.Trim()
NumContainer = (txtPartNumber.Text.Trim / 1000 + 1).toString.Split(".").First

[Code] ....

How to achieve this results to access to the server drive to get images for view by using VB.NET or C# in code-behind. Servermappath, UNC, or else?

View 1 Replies

Web Forms :: How To Get IP Of Users System Machine When Visits Page

May 17, 2013

How I can get the IPS of all the computers through which users are accessing my website.

View 1 Replies

Configuration :: Testing Multiple Users On Local Network?

Sep 23, 2010

I have VWD 2010 Express installed. While developing I would like my co-workers to test the application (the parts that are "finished"). When I click "View in browser" for some web form of my application or "Start debugging" the app is shown in my browser at:

http://localhost:3424/Default.aspx

My IP on local network is 192.168.1.14. How can my co-workers access this page?

Note: I do not have IIS instaled (just ASP.NET Development Server).

View 2 Replies

Security :: Add And Remove Users From A Local Group Of A Remote Computer?

Feb 16, 2010

I want to populate members of a local computer group on a webpage and allow the user to add / remove users of that remote computer from a group say Administrators or Remote Users Group.

The application pool will be running with a user who is admin on all remove systems.

View 5 Replies

C# - Disconnecting Users Terminal Service Session Via Local Intranet

Aug 11, 2010

I have written code that uses a .bat file (code: rwvinstat /server:servername) that populates a DataGrid of users logged in to a terminal service session in c#. The .bat lives on the server with the app. files and will run properly if executed manually on the server .Also if i run the app. locally and call the .bat file on the server it works fine.

The problem is when i deploy my web app on the server the DataGrid never populates nor do i get any errors. i have given full permissions to IUSER_MACHINENAME(and various users) and i set the virtual directory permissions to read, run, execute. Ialso have set my web.conf fig to:< "identity impersonate="true" userName="username" password="password"/> Here is my Source code:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.IO;
public partial class ilsap01_users : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("C:\listUsersIlsap01.bat");
psi.RedirectStandardOutput = true;
psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
psi.UseShellExecute = false;
System.Diagnostics.Process listFiles;
listFiles = System.Diagnostics.Process.Start(psi);
System.IO.StreamReader rawUserData = listFiles.StandardOutput;
listFiles.WaitForExit(20000);
try..................

View 2 Replies

VS 2010 - Access Local File System

Apr 26, 2012

I have an ASP.NET page that I need to have access the local file system. It's an intranet. I need to download a zip file and an executable to a temp location and then run the executable.

Then afterwards, I need to delete the contents via an ASP.NET page.

Is there any way to access the local file system? Generally, I would think this would cause a security concern, but I've seen posts about Silverlight being able to access it.

View 4 Replies

Configuration :: Deploy Project Including DB In Local System

Jan 26, 2011

I have tried to deploy a project using Windows Installer Deployment. And Successfully installed it in computer. But it is unable to connect with the Database in my system. Earlier the same project worked from my Visual studio but it is not working after the deployment.

View 3 Replies

Security :: How To Make Hostname Map To Localhost On Local System

Apr 13, 2010

I developed a website on VS2008, which I then published by right-clicking. I can locally browse that website using[URL]

but when I try giving hostname in place of localhost it fails to resolve. Can this mapping be specified in hosts file?

View 9 Replies

Configuration :: Configure Smtp Server On Local System?

Oct 9, 2010

I'm using one XP with SP 2 as my local Laptop PC . Its IIS has one default web site, of course, which is the site I'm working on. When some feature is finished I deploy it to my "production" site which is hosted somewhere else. Very common situation, I guess. This app uses email to notify customers of some particular events. Works on production, but sometimes I need to change something in the way those notifications work. Currently I have to upload the changes to "production" to check it out. Is there any way for me to set up smtp server on my local machine so I could work locally with those features?

View 3 Replies

Making Hide / Show Files And Folders In Local System?

Dec 8, 2010

I am tring to hide a image in local folder by asp.net. How to get this.

send me a sample code ,I tring that filename.attributes.hidden

View 3 Replies

Howto Get Local Site To Work - Setting To Change The System

Jan 5, 2010

I've received a website that uses sql server on the live environment. In the code at many places sql is created, say: However, locally on my dev machine, I use sql server express edition. It looks like select * from mytable doesn't work there, but instead I should use: How can I get my local site to work? Is there a setting I can change or am I missing something else?

View 5 Replies

Smtp Is No Sending Email Instantly - It Makes A Queue In Local System

Aug 28, 2010

I am using a smtp to send email from asp.net (C#)code. it sending some email instantly but many of email is making a queue in my Inetpub folder at local system.

View 3 Replies

AJAX :: Update Progress Working Fine On Local System But Not On Web Server

Mar 18, 2010

Ajax I have used update progress. its working fine on local system, but not on web server. Actually pagepostbacks.on server there is IIS7.

View 5 Replies

Could Not Upload Files To Mapped Network Drives

Jan 7, 2010

I have created an application to upload files to a mapped network drive(say: Z:), but is showing the error:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'Z'.

What i did:

Created a web page with FileUpload control & a button.In button click event i have used the code as below.

[Code]....

View 9 Replies

Networking - Accessing Mapped Drives When Impersonating?

Apr 19, 2010

Short Version: Can anyone say whether it's possible or not to use impersonation in ASP.NET to access mapped drives?

Long Version:
I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined for the user account I'm impersonating.

For example, let's say a file lives on the network at "machinefolderfile.txt", and let's also say that drive S: is mapped to "machinefolder". We need to be able to access both the full UNC path, "machinefolderfile.txt", as well as the shorter, mapped drive path, "S:file.txt".

Obviously the standard ASP.NET process cannot access either.

Using a console application that runs under the local account with the mapped S: drive, calling File.Exists(@"machinefolderfile.txt") returns true, and File.Exists(@"S:file.txt") also returns true.

However, when impersonating in an ASP.NET context with the same local account, only File.Exists(@"machinefolderfile.txt") returns true. File.Exists(@"S:file.txt") returns false.

I'm testing with IIS 7 running on my local Windows 7 Professional box, though this will need to run in both IIS 6 and IIS 7.

Impersonation is handled with a couple of classes in C# which I'll include here:

public static class Impersonation
{
private static WindowsImpersonationContext context;
public static void ImpersonateUser(string username, string password)
{
ImpersonateUser(".", username, password);
}
public static void ImpersonateUser(string domain, string username, string password)
{
StopImpersonating();
IntPtr userToken;
var returnValue = ImpersonationImports.LogonUser(username, domain, password,
ImpersonationImports.LOGON32_LOGON_INTERACTIVE,
ImpersonationImports.LOGON32_PROVIDER_DEFAULT,
out userToken);
context = WindowsIdentity.Impersonate(userToken);
}
public static void StopImpersonating()
{
if (context != null)
{
context.Undo();
context = null;
}
}
}
public static class ImpersonationImports
{
public const int LOGON32_LOGON_INTERACTIVE = 2;
public const int LOGON32_LOGON_NETWORK = 3;
public const int LOGON32_LOGON_BATCH = 4;
public const int LOGON32_LOGON_SERVICE = 5;
public const int LOGON32_LOGON_UNLOCK = 7;
public const int LOGON32_LOGON_NETWORK_CLEARTEXT = 8;
public const int LOGON32_LOGON_NEW_CREDENTIALS = 9;
public const int LOGON32_PROVIDER_DEFAULT = 0;
[DllImport("advapi32.dll", SetLastError = true)]
public static extern int LogonUser(
string lpszUsername,
string lpszDomain,
string lpszPassword,
int dwLogonType,
int dwLogonProvider,
out IntPtr phToken
);
[DllImport("advapi32.dll", SetLastError = true)]
public static extern int ImpersonateLoggedOnUser(
IntPtr hToken
);
[DllImport("advapi32.dll", SetLastError = true)]
public static extern int RevertToSelf();
[DllImport("kernel32.dll", SetLastError = true)]
public static extern int CloseHandle(IntPtr hObject);
}

Then, during Page_Load, we basically do something like this:

Impersonation.ImpersonateUser("DOMAIN", "username", "password");

if (!File.Exists(@"S:file.txt"))
throw new WeCannotContinueException();

I realize using mapped drives isn't a best practice, but for legacy reasons it's desirable for our business. Can anyone say whether it's possible or not to use impersonation in ASP.NET to access mapped drives?

View 2 Replies

Crystal Reports :: Export And Print Buttons In Crviewer Are Working Fine In Local System?

Feb 23, 2010

I am using crystal reports in my web application which came along with visual studio 2008.My problem here is export and print buttons in crviewer are working fine in my local system but when i hosted the app in server actual problem came into picture.Export and print buttons are not working.

View 1 Replies

Find Out Users Browser And Operating System?

Sep 29, 2010

Is there a way in ASP.Net to find out the browser and operating system of the user?

View 1 Replies

Building A Page To List Files In Directory On Web Server And Network Drives?

May 17, 2010

I have seen some examples on other sites , but since im not familiar enough with DirectoryInfo and Files from the System.IO namespace, i dont know how to change it to fit my needs. So i found a very simple example that works, but i have some questions.

Here is the code i found:

[Code]....

This works great and lists the files in my root directory.

#1 - What i need to know is how to accomplish the same thing but in a format i can control, this code simply displays the files at the top of my page and pushes everything down. So does anyone know of a good and simple tutorial written in C#?

#2 - I also need to be able to setup the code so that certain files within the directories are not displayed, as in the code behind files and other files to be determined by the business.

View 2 Replies







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