TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
R
NA
8
0
Problem while saving a file to Diffrenet server or Machine using windows service?
Nov 6 2009 6:22 AM
Hi
I implemeted a windows service.It was installed on a "
Machine A
" .
The job of this service is read a file from a specified folder in "
Machine A
"
and move it to
"Machine B"'s
Shared folder.
"
Machine B
"'S Shared folder having full rights for a "
User A
". and i am imporsinating with
"User A"
to move file from "
MACHINE A
" to "
MACHINE B
".
It's throwing
"Access Denied Error"
Please let me know what went wrong with this?
private void MoveFile(FileInfo file)
{
try
{
if (objImp.impersonateValidUser())//immporsinate with user A
file.MoveTo("
\\\\Machine
B\\Shared Folder\\" + file.Name);
}
catch (Exception ex)
{
//Saev error message
}
finally
{
objImp.undoImpersonation();
}
}
Thanks
Rakesh
Reply
Answers (
2
)
Discount Hosting
HttpWebResponse by WebService