.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to move a file from one domain to another domain?

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
The following code works as it was originally designed to move a file from one directory to another directory on the same server, but I need to change it to work so it will move a file from one server to another server.  My challenge is how to define the source directory on a different server and check if file exists. Please help.Code behind:Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click         Dim sFile, source, target, link As String         sFile = FileUpload1.FileName         source = "r:\storage\uploaded" & sFile         target = "r:\storage\" & DepartmentList.SelectedValue & "\" & InstructorList.SelectedValue & "\" & CourseNameList.SelectedValue & "\" & sFile         link = "http://someserver.com/upload/" & DepartmentList.SelectedValue & "/" & InstructorList.SelectedValue & "/" & CourseNameList.SelectedValue & "/" & sFile           'Start SelectedValue is not empty         If Not (DepartmentList.SelectedValue = "" Or InstructorList.SelectedValue = "" Or CourseNameList.SelectedValue = "

View Complete Post

More Related Resource Links

Move MySite with stsadm backup from FARM A to FARM B within same Domain

Hi, I'd to move, with a series of "stsadm -o backup -url..." command, a lot of mySites from one Farm to another in the same Active Directory. Are there special Tasks after the "stsadm -o restore -newurl ..." command ? Can I handle MySite like a "normal" Team Sites ? I'm not sure what happen, for the Users after the new MySite URL become active (I hope it will not create a new empty one) ThanksTester

Accessing a flat file/folder via SSIS that is out of my domain


I'm trying to copy a file to a desitnation in an SSIS package that requires a username and password in order to connect. I am doing this in VB Script task and have tried this:


Dim ServerShare, UserName, Password As String
Dim NetworkObject, FSO As Object
ServerShare = \\someserver\sharename$

Domain account from SQL box needs to access file share on DMZ server


We have a web server set up on the DMZ that talks to a SQL 2005 server on the company domain.

The issue is, we are trying to install this CMS engine that requires a domain account from the SQL server to access a share on the web server that is in the DMZ. 

Is there a way to trust a domain account to have access to a share on the DMZ server?  I have heard of "read only" and one way trusts.  Is that secure and if so how would we go about setting that up?

Basically I want to avoid at all costs of putting the SQL Server on the DMZ server but need a seamless way to access a file share from the trusted SQL Server.

AutoGenerateSelectButton="False" ignored when using Domain Service


Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?

Dynamic Data, Domain datasource, Poco and lookups


Mr. Edward,

Excuse my question but: it is necessary to involve in our projects something more than just Dynamic Data or should we make use of all other features available in VS2010 (which will make assume taht they had been left out of the Dynamic Data framework) like: wef, poco, azure, wcf, cloud, mvc, silverllight, ajax, odata, agile, workflow, etc.?

Sorry my ignorance, I'm just transcribing names as they come to my mind and of which I don't know anything about


Carlos Porras (El Salvador)

Pass ASP.NET membership identity object across domain?


I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?

If this is possible, I am going to implement this solution. Please tell me what's your take on this.

How do I preserve __viewstate between cross domain posts or how do I get a __viewstate of a Remote S


Here is what I want to do:
I have a local site in which I want to display data from a remote site
Lets say: I want to display data of http://www.abc.com/Default.aspx on my localhost

Now Default.aspx requires some post-data which it sends to itself. Thus the __viewstate and __eventvalidation are posted back to it by itself. I want to directly post the data to Default.aspx from localhost without opening Default.aspx and display the Default.aspx's response on my localhost.

The WebApp on http://www.abc.com is configured for __eventvalidation i.e. I cannot post-data to it from my localhost without getting a __viewstate from it. I also have to post the current __viewstate of http://www.abc.com/Default.aspx to itself

How can I accomplish it?

How to authenticate local user usin ldap or non domain authentication



I created one application, and I need to authenticate local user. This user is the user who is login to his/her Personal Computer.. Main thing his that he/she does not in any DOMAIN... I want NON-DOMAIN authentication.. any how.... please help...

Patterns in Practice: Internal Domain Specific Languages


Jeremy Miller explains how internal Domain Specific Languages can help you craft code that is easier to read and write. His bag of tricks to improve your programming includes extension methods, fluent interfaces, object extensions and use of the semantic model.

Jeremy Miller

MSDN Magazine January 2010

Domain Models: Employing the Domain Model Pattern


In this article, we'll go through the reasons to (and not to) employ the domain model pattern, the benefits it brings, as well as provide some practical tips on keeping the overall solution as simple as possible.

Udi Dahan

MSDN Magazine August 2009

Best Practice: An Introduction To Domain-Driven Design


We give you a gentle introduction to designing and evolving rich domain models as part of integrating Domain-Driven Design (DDD) into your coding efforts.

David Laribee

MSDN Magazine February 2009

ASP.NET Proxy Page - Used for Cross Domain Requests from AJAX and JavaScript

The article ASP.NET Proxy Page - Used for Cross Domain Requests from AJAX and JavaScript was added by Aamir Hasan on Thursday, August 19, 2010.

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn't allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull content

WSS 3.0 using new domain



I have currently a WSS 3.0 server  (internal DB/Single Farm) running for our intranet and I use http://intranet/ to access it. Everything works fine, authentication, permissions etc.


However, I've forwarded our external domain http://beta.somedomain.com/ to IP address of our Intranet. The intranet loads fine but its just that sometimes the authentication box would pop up asking me to authenticate, sometimes it is successful and sometimes its not, even when using correct credentials.

I am assuming it has something to do with new domain and the way it tries to authenticate with AD as it uses beta.somedomain.com\username instead of ActiveDirectoryName\username


So whats the best way to add an external domain to work without any problems? I have set up "Alternate Access Mapping" and my configuration is such:

Internal URL                                      Zone                               

Moving SharePoint 2007 from Domain to a Workgroup


For development purposes, we have SharePoint 2007 installed on a virtual server (Wind 2003) on a company desktop (Vista Business ed.).  The SharePoint is using Active Directory and company domain. For learning purposes, we want to copy the virtual machine on another Vista machine that is outside the domain and is not using AD:

Question 1 : How can we move the SharePoint from a domain to a Workgroup
Question 2: Is it possible to still be able to use emails (through local installation of Outlook) on the same computer that is not on the domain? If, yes, what are the possibilities (any articles on it? Etc.)?


Domain & Active Directory


Scenario 1:

Site user visits http://intranet/ , authenticates using intranet\username as username using proper password. Everything works fine.

Scenario 2:

Site user visits http://somedomain.com (that is forwarded to IP address of "intranet") , sharepoint opens, authenticates sometimes but sometimes it wont. Even if it authenticates user , some actions (edit an item) pops up authentication dialog box and fails to authenticate further even with correct credentials.


Do I need to add somedomain.com to Domain Controller of "Intranet"?  It is running 2k3 windows, IIS, Domain controller, sharepoint WSS 3.0 server (Internal).



Please advice,


Create COM object from ProgID in a separate domain

Hi, How should I create COM object from ProgID in a separate app. domain? After I created corresponding Type object by means of Type.GetTypeFromProgID, I cannot use neither Activator.CreateInstance nor <MySeparateAppDomain>.CreateInstance because both require assembly name as one of the arguments... but as I said before I have no RCW assembly - just a ProgID. Those Activator.CreateInstance overloads which have argument of AppDomain type do not accept argument of Type type, only argument "assembly name" (of String type). And neither of <MySeparateAppDomain>.CreateInstance overloads accept argument of Type type (all require assembly name and type name). Any ideas?!

How to set Host's Domain Manager in a created AppDomain

I am not sure if this is possible but I would want something similar to loading the Host's domain manager to my new AppDomain. There is no Domain Manager for a newly created AppDomain. Owing to this many of my subsequent call fails. For example if I make a call to "Assembly.GetEntryAssembly" it returns null in the new AppDomain. To workaround this I will have to call "AppDomain.ExecuteAssembly("entryassembly")" in my created AppDomain. I actually do not have a need to do this in my application. Similarly there are other calls such as "ScriptEngine.GetSearchPaths". This again does not return the expected search paths in my new AppDomain. Again if I perform "AppDomain.ExecuteAssembly("entryassembly")" then the expected search path is returned. So in short a domain manager is created in my new AppDomain only when i execute the entry assembly in my new AppDomain; which internally provides me a domain manager similar to the Host's domain Manager (as i execute the same entry assembly). Is there a way to load the Host's domain manager without executing any assembly in my new AppDomain. I am using VS 2008, .Net Framework 2.0.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend