Cross Domain File Copy Using .NET?
Mar 12, 2011
I have a file that is being generated automatically on a server in a Windows domain, say, called, "prod" and I will need to have VB.NET to transmit this file to another server in another Windows domain, say, "QA", where QA and Prod have different credentials altogether and I have to authenticate that credential every time I opened up the destination folder.Therefore, I guess the regular filecopy method would not work?
View 2 Replies
ADVERTISEMENT
Dec 9, 2011
I have a question. I'm deploying my VB app that performs some task VIA SCCM. The application is run with the NTAuthoritySystem account.
I would like to copy a log file to a server all domain users/computer can right to this folder. I'm trying to get a log copied to the server but since it's running as the system account it can't authenticate to the share to save the log file on XP machines.
Can somebody show me example code of how to save a file as a different user when running the program with the system account . Would this be secure to use a domain account to impersonate and save the file?
View 2 Replies
Aug 15, 2011
i need to copy file from domain to workgroup and one domain to another domain and workgroup to domain
how to copy file with authentication
View 1 Replies
Apr 24, 2009
I have a program that I copy a file from one server to another. This has been working well if the servers are on the same domain.I now need to copy a file to a server on a different domain. If I were to do this manually it would prompt me for my username and password.
I don't see any way to put a username and password with doing an IO.File.Copy. Is there a better way to do this?IO.File.Copy(strSource, strDest)
View 1 Replies
Feb 21, 2011
I have a facebook iframe app I'm trying to test using a WebBrowser Control on a form in VB.NET 2010. Whenever I try to access the WebBrowser.Document.Window.Frames frame object on a document where my app is showing in the broswer, I get an Access Denined exception. Reading around on the web, I see people saying that this is to keep scripts in a document from accessing content in iframes that are pulling content from another domain, as per [URL] for security reasons.
While I totally understand why this is done for the general public, how can I disable it on my machine so that I can run these tests? I can't properly test my app without doing it in the facebook iframe and using the WebBrowser control is the only way I know to do this test programmatically. I'm on windows server 2003 and ie8, .net4.0, if that helps. I own the domain where the app is, and its in AS.NET MVC2, so if there's anything I can do to the web code to enable this??? I also removed the Internet Explorer ENhanced Security COnfiguaration component, but that didn't help.
View 1 Replies
Jul 18, 2009
I'm trying to make a process explorer/Blocker.It has two DGV's. In the first DGV it populates a list of all the running proceses.In the second, a list of blocked processes. Using a button, the user can move a process from one GDV to another.This is where I'm stuck.I can only get the position of the cell for some reason when I'm trying to get the text in all the selected cells.
Private Sub Blk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Blk.Click
Dim isblked As Boolean = False
For Each cell In Allwd.SelectedCells
[code]....
View 1 Replies
Sep 22, 2010
I have a function that works perfectly when I attempt to add a user from the same domain into a group of the same domain.
Function AddUserToGroup(ByVal strUserDN As String, ByVal strGroupDN As String, ByVal strGRPDC As String, ByVal strUserDC As String) As Boolean
Dim oUser As DirectoryEntry
[Code]....
The error is actually being thrown on the Invoke line, but as I said earlier, if the user is in the same domain, this works perfectly.
View 1 Replies
Aug 5, 2010
I have a program that uses IO.File.Copy to copy files from point a to point b. Its slow, which is fine because there rather large files. I was wondering if there is way to get an estimate time to copy a particular file(s).
Example: File a will take 1 hour to copy, File B will take 30 minutes to copy. Estimate Total Time: 1 hour 30 minutes.
View 3 Replies
Jun 30, 2009
it's like a diff language to me. But I need one quick to accomplish a task.I need to take
[URL]
and get just
/folder1/folder2/file_path.txt
from it.
View 4 Replies
May 16, 2011
I am putting together an old post here with this new one. My main goal is to combine these two portions so that the search does not need to be ran on each and every computer.
[Code]...
I can set the path as WinNT://domain.name/username...and I get a list of something, are they files? i am not sure? Second portion of code searches the computer for the java.exe to display its version, as well as searching for any indication of a java file on that computer.
[Code]...
View 1 Replies
Nov 2, 2010
I have an FTP Server outside of the domain (In a workgroup). I need to move files using an application called by the FTP client on the FTP server to a share within the domain using VB.net:
(System.IO.File.Move(SourcePath & Filename, TargetPath & Filename))Impersonation will not work neither will mapping a drive (As no user will be logged on)This is a console application that takes the above parameters.
View 1 Replies
Nov 1, 2011
I'm working on a little script to automate tasks across 12 servers, that are all on the same domain and have a similar setup. The tasks are to create a new folder, to then copy contents off the network into it, and to create a virtual directory in IIS 6 pointing to it. Ideally I'd like to log errors but that's a later concern. My approach was to write a VB Script to connect to WMI on each server in an array, then use it to run off a batch file. While the VBS works if I tell it to create a folder directly, it does not run (any part of) the batch file, nor give me any errors.[code]...
View 2 Replies
Jun 18, 2011
I have a winforms application and would like to allow the application to open and save files from/to a folder on the network (acting as a document manager). Only one user has access to the folder and I can hard code that users credentials into the application. Where using AD on windows server.How do I allow the application to do this?I would prefer not to use impersonation but from my research it appear I may have to. I would welcome suggestions for alternative methods. I do have some code for impersonation which seems to work. However I cannot open the file using process.start I get access denied.
[Code]...
View 8 Replies
May 27, 2011
I have a weird behavior when trying to copy a file with System.IO.File.Copy. The file never gets copied. More than that, the call doesn't generate an exeption!
I am using VB.NET, Framework 3.5. I'm trying to copy in C:Temp and I do have the privileges. Or at least I used to...
View 2 Replies
May 21, 2009
I have created a file watcher but I have a problem with the file watcher.here is the
vb.net
Inherits System.Windows.Forms.Form
Private watchfolder As IO.FileSystemWatcher[code]....
And I have the Following error
InvalidOperationException
"Cross-thread operation not valid: Control 'txtmonitor' accessed from a thread other than the thread it was create on."
View 4 Replies
Mar 27, 2009
I've got an app which uses a background worker to copy files. It works fine but some files are quite large and it "appears" as though the app isn't doing anything. Is there an alternative to the File.Copy method of copying files so I can report on the progress of individual file copies, like the percentage complete?
View 19 Replies
Aug 12, 2010
Before I begin I would like to mention that I am not a noob in VB, it's just I've never had to do anything this complex before. Basically what I want is to have a program that you can load a txt file in, have it copy key words, and paste it in a textbox so I can use it later on. So in this text file, there is a bunch of info, but I am only needing a certain part. Here is an example of a text file (actually a .dat file, but is easily read):
[Code]...
View 3 Replies
Jul 22, 2011
i am very new to VB. I am working on file operation such as show files, copy file, delete file, show current directory, rename folder, make folder. My problem right now is with delete and copy file. I have a method of delete and copy but i dont know how to pass this method on a button.
[Code]...
View 8 Replies
Jun 2, 2012
I am wondering if Global.asa can handle a procedure like this:
Protected Sub errore(tipo As Int16)
'Response.Write(Err.Description) 'or your own custom error message
Dim msg As String
[CODE]...
The idea is to have a central place to put the routine in instead to copy it into every .vb file that belongs to each .apsx code file.
View 4 Replies
Aug 11, 2009
Here's my
[Code]...
During the file copy, Label2 isn't being updated. In fact, my whole form goes non-responsive. How can I fix this?
View 5 Replies
Aug 14, 2009
I am developing an Application in VB.Net 2.0. I have a module which would copy files from the Local Machine to a shared folder on remote machine. This shared folder on the remote machine is an authenticated folder. So, after searching on the Internet I found the following piece of code.[code]Another point to note is that when I connect to the File Share using Windows Explorer and then try to execute the application, it works properly.I am not sure why I am getting the error when I do not connect to the Shared Folder using Windows Explorer.Do I have to set some property so that the Credentials passed in the authentication are used.I also checked some posts that suggested setting up Mapped Drive to the Shared Folder on the Local machine and then to copy the file using IO.File.Copy function. However, I cannot use this as this Remote Folder should be only accessed through the application and not in any other case by the User. The users will not even have the credentials to this remote Server as it will be configured by the admin.So, Is there any way in which I can set this up and transfer the files from local machine to a remote shared folder?
View 3 Replies
Jan 10, 2009
Im trying to file copy a certain file in our server and it says QuoteLogon failure: unknown user name or bad password. this is my code fileCopy (OpenFileDialog1.FileName, "\\SERVER\System\PictureDataBase\" & txtSurname.Text & ".jpg")
View 2 Replies
Apr 2, 2009
Ideally I'd like to be able to copy/move between an accessible folder on my local drive and a network share that I don't have permission to access (but the application would). I am using impersonation to give me access to the files in the network share but using System.IO File.Move or File.Copy forces me to use the same credentials for each location. Is there a way around this?
View 2 Replies
Sep 14, 2011
In my program I allow the user to copy a file from one folder to another. If the file already exists in the target folder I want it to be overwritten.
All that works just fine - I'm not asking how to copy files.
But here's an example
Source file is:-
\SomeMachinesomeFolderfile.xyz
Target is:-
P:file.xyz
This might at first look like two separate files but in this case P: is mapped to \SomeMachinesomeFolder so the source and the target are actually the same file and the file copy will obviously fail.
Of course I want it to fail but my problem is that the windows generic error message seen by the user is not very helpful. It says something simple like "... can't be copied because it's busy". If the user isn't very bright he doesn't realize he's selected the same file both as source and target and he doesn't understand why it's busy.
What I want to do is detect in advance that the source and the target are the same file and display a more meaningful message to the user and not even bother trying to copy.
So, is there a way to detect that
\SomeMachinesomeFolderfile.xyz
and
P:file.xyz
are actually the same file?
View 8 Replies
Oct 20, 2010
Recursive File Copy based on file extension. I have a single root folder that contains numerous folders that contain a few files that I want to extract. For this example, lets state that I want to copy all �txt� extensions and put them into a repository folder.
Example:
\root
\root\Folder1\
\root\Folder1\abc.txt
[code]....
View 6 Replies
Dec 14, 2009
I cannot do the following:
File.Copy(Application.StartupPath & "wait.exe", "%APPDATA%WAIT.EXE")
Can someone remind me how I got about copying a file to that location?
View 1 Replies
May 22, 2012
So, I have a task where I need to basically copy about 600,000 PDFs, some of which can be 5-6 MBs from one network fileshare to another network fileshare on another pc.Now, I crawled through the directories, sub-directories etc etc and created what I call a Filename/Filepath Database lookup table. This table contains the name and the unc fileshare path of each file which comes in handy.I have used Multi-threading and File.Copy to "copy" the files and I getting about 45K files per 4 hours which I need to be significantly faster then that and I am seeing performance degrade over time
View 1 Replies
Apr 12, 2011
I am working on a program using VB.Net 2010 which will enable me to setup groups of files & folders for back up with syncing capabilities etc. I have a concept program which is based on some sample code I found out in one of the VB.Net forums. I have modified it from a command line based program to a form based program. At the moment I consider this code to be a "concept" program which once I have the various copy/sync routines developed and debugged will be integrated in to another program I wrote for
creating "Back Up" groups to automate the process. There are some 3rd party programs that do similar things that I want to do such as Microsofts Sync Toy, but none of them offer the grouping and exclusions options that I am going to program in to this backup/sync program.
So here is my problem, I have the included code taking two folders, a source and a destination, and copying everything from the source to the destination. It will skip over any unchanged files/folders and will delete anything found in the destination folder that is not found in the source folder and it will update all files in the destination folder that have a newer version in the source folder. In other words it will mirror image the source to the destination but will be smart enough not to copy unchanged items from the source to the destination thereby saving a lot of time. The sync part of the program is working fine, the displaying of the progress and results is not.
[Code]...
View 2 Replies
Aug 6, 2009
Is it possible to make sort of an installer where you have your files you wan to install in the Project resurces file and then copy and paste them into a directory?
View 16 Replies
Oct 6, 2009
I have used the following method to copy a file from one location to another:
My.Computer.FileSystem.CopyFile(WorkPath$ & "vmcg.vmc", sessionsPath$ & "vmcg.vmc", True)
with workpath being the original location and sessionspath being a string with the new location. True is the overwrite property.The file copies a blank file with the same name, but what i want (obviously) is to copy the file and the contents.ie how am i suppose to copy a file?If you're not living on the edge, you're taking up too much room?
View 5 Replies