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


Similar Messages:

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

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

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

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

Forms Data Controls :: Showing Xml From Sql Server?

Feb 12, 2011

I want to show xml which is load from sql server with the following code but I dont know for showing that in web which control is suitable?the code is as follow:

using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["WebApplication1.Properties.Settings.mycon"].ConnectionString))
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from ajaxmovie FOR XML AUTO ", con);
XmlReader xr = cmd.ExecuteXmlReader();
xr.Read();
string data;
do{
data=xr.ReadOuterXml();
}
while(!string.IsNullOrEmpty(data));

View 2 Replies

Web Forms :: Server.HtmlEncode Not Showing Or Decoding When Performing POST

Nov 9, 2010

I am trying to set up a POST from one aspx file to another progromatically. Inside the POST is a String of XML data which i have properly added to Server.HtmlEncode(). For some reason, when I grab it in my logs on the other page, it is showing with 3 question marks. I at first thought it was logging text i left somewhere, but have narrowed it down to a Encoding error of some sort because when i change the encoding it changes the character, and when I just put some text in there, i see it on the other side fine. i have tried UTF 8,UTF32,Unicode,ASCII... Can't seem to find the right combination. Can't find the UTF-16
when I use the Encoding object

Below is my Code:

[Code]....My Sending Debug log has the Extension xml coming out in HTML format correctly before POST. Below is just a piece of it[Code]....

And then on the other side log I get the below

Extensions =??

View 1 Replies

Web Forms :: After Downloading File From Remote Server Other Controls Not Showing

Jun 8, 2012

I am downloading file from remote server in page load using content disposition. After downloading the file i am trying show some other controls in the page. But that controls are showing asp.net .

View 1 Replies

Not Showing Sql Server Name?

Jan 14, 2011

i just want know about my sql server name not showing..

View 11 Replies

SQL Server :: Showing One Record For X Or Y Or X And Y?

Jan 7, 2011

I'm not sure if I can do this, but I've been trying my hardest.

I have a company that catagorizes people under Membership 1 and Membership 2.

It is possible for a person to have 0, 1, or 2 of these memberships.

I have a select statement, that I'm building in a view, that shows if a person has no membership, Membership 1, or Membership 2 along with their name, user id, and company. However, if the person has both Membership 1 and Membership 2 it is showing up as two records.

Can I have it show all of this information in one record per user?

View 6 Replies

SQL Server :: SSIS Project Templates Not Showing?

Sep 29, 2010

this is an issue regarfding the SQL Severe Integration Services

I have installed the Business Intelligence Studio through SQLEXPR_TOOLKIT.EXE

but the problem is when i am trying to create the SSIS Project it is not showing the SSIS Project Templates in BID .

I have try to change the location of Templates in Tools --> Option --> project & Solution but the still the problem is same

View 5 Replies

Development Server Not Showing Up To Date Representation Of The Site?

Aug 15, 2010

I was creating my new webforms application and testing it. Now I added a new textbox to the form and when pressing F5 to test, it doesn't show. None of the changes show when I try to test it.

View 1 Replies

Installation :: Adding The Application In Server Vss - Showing Dll Error?

Aug 26, 2010

My asp.net application running properly in single machine and even server itself . But when i installed the microsoft vss on server and cline machine and added the application in server vss itself. But that time it self it showing dll error . I am using Windows Xp Os. My vss is microsoft vss 2005

View 1 Replies

Visual Studio :: Server Controls Not Showing In 2010?

Jul 29, 2010

ALL the server controls are not showing in Visual Studio ASP.net project. It used to be intermittent, I would restart devenv and they would show again(even if the layout was terrible) Anyhow now it's not showing at all. The only change I made to the project was to switch Membership providers to MySql. Even pages that have no reference to Membership don't display.Anything(page wise) that has a server control fails (displayes the message "hresult e_fail when creating com component") even if it's just a label with no programming logic.

View 2 Replies

Error Showing The Place Of Origin To Be Local Instead Of Web Server?

Jan 7, 2010

I have a web server on which I deploy my asp.net project after publishing. However many times I have noticed that when any error occurs on the web server I see that the error location is showing path of my local machine on the webserver and not the path of the web server.

View 2 Replies

Labels On X-axis Are Not Showing In Sql Server 2008 Report?

Sep 27, 2010

The bar chart report is showing data on x and y axis (y axis has 3 fields - min, max, avg values for time frame) and x axis has task type. For some reason, the chart only shows task types on the x-axis for some apparently interval, even though I have no interval set expressly.

View 1 Replies

SQL Server :: Scheduling System - Showing Data Using Relation Shift

Jul 26, 2010

How I will create the scheduling system. I have 3 tables related namely employees, schedule and shift. How will I show the data using the relation shift of the table on gridview by this: It will be filtered by datefrom and dateto: Select via calendar ex Datefrom: August 1 Dateto: August15

Then It will show:
EmployeeID Name
1 2 3 4 5 and up to 15

EP9112 Lastname, firstname, Middlename shift shift shift shift shift
with edit when I press EmployeeID their shift.
How can I also format the shift and date by: ex TimeIn: 7:00:00 AM TimeOut: 3:00:00 PM Date: 8/1/2010
When I add it, it will be TimeIn: 8/1/2010 7:00:00AM TimeOut: 8/1/2010 3:00:00 PM.
Do I need to edit my database.

View 5 Replies

Custom Server Controls :: CssClassProperty Not Showing List Of CSS Classes?

Mar 17, 2010

I defined the property as follow and in the Properties window, it just shows an empty textbox. While the CssClass property shows a list of CSS classes.

[CssClassProperty]
public
string HeaderStyleCssClass
{
get
{
return headerStyle;
{
set
{
this.headerStyle =
value;
}
}

View 3 Replies

IIS Configuration :: Mondor Captcha Image Not Showing When Deployed In Server

Feb 25, 2016

I have implemented captcha control in my webpage based on the article How to implement Captcha in ASP.Net.

It is working fine when running through the VS IDE, but when i deployed the website in IIS 8 (Windows 8.1) server the captcha image does not show. 

View 1 Replies

Databases :: Uploading An Excel (.xls) File To Server And Showing It To Grid View?

Apr 25, 2010

[Code]....

i have successfully showed data using puting directpath in to a textbox(e.g, filename=TextBox1.Text;). but the code above is not working. i dont know why.

View 1 Replies

ADO.NET :: Showing The Sql Select Statement Instead Of Showing The Result

Nov 8, 2010

I have the following simple linq to sql statement:

[Code]....

Instead of showing me the UserName from the aspnet_Users table, it showed me the SQL select statement.

View 2 Replies

DataSource Controls :: Sql Server Authentication Showing An Error 'Login Failed For User?

Jun 15, 2010

while i was using sql server authentication, it was running a quite good but suddenly it starts showing an error 'Login Failed for user sa'

Here is my error-Login failed for user 'sa'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'sa'.

Here is my code-

<add name="MyDB" connectionString="Data Source=ERPTEST;Initial Catalog=LoginDatabase;User ID=sa;Password=sa"
providerName="System.Data.SqlClient" />

View 2 Replies

DataSource Controls :: Custom Database Created In Visual Studio 2008 Not Showing Up In .NET SQL Server Setup Wizard?

Apr 11, 2010

I created and populated a database inside Visual Studio 2008 instead of using Management Studio.I need to run the script to create the schema for users and roles.The database does not show up in ASP.NET SQL Server Setup Wizard or in Management StudioThe only databases that do show up are master, model, msdb, and tempdb

Is there anything I can do to fix this or would it be easier for me to just create a new database starting in Management Studio and then connect to it from within Visual Studio?

View 4 Replies

Showing .aspx Files On Server After "copy Website"-ftp?

Mar 8, 2011

I had problems showing my .aspx files on my server after "copy website"-ftp, as the server had ASP.NET version 2.0. However, html-files worked like a charm. I got my server-dude to install ASP.NET 4.0 on server, and I can now publish an empty aspx-file only containing text without error. BUT, if I add a standard login-form from ASP.Net and copy the website, it says "Server Error in '/' Application", "Configuration Error" blablabla and "Line 8: roleManager enabled = "true"/>" is highlighted in red..And also some IIS-errors. What is IIS? I thought IIS was for people who ran websites from their computers? Is this an IIS-error? What can I do to fix this?

View 9 Replies







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