473,769 Members | 6,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem while Writing to Remote Location in a .net Thread

4 New Member
hi

i am having problem when i am trying to write something on remote location using .net thread.
e.g. i have a central location letsay MachineName|Mac hineIP/SharedDrive.
and i am creating a thread on click of a button which i need to write some information on that location.

i have also added a node <identity impersonate="tr ue" userName="Domai n\User" password="***** **"/> in web.config of my application.

and i have also given credential in <Machine.Config >--<ProcessModel enable="true" UserName="SameI nWeb.Config" password="SameI nWeb.Config">

but it is giving the following exception:
The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.

below is my method which i am calling on a separate thread.
private void WriteSomeThingT oRemoteLocation ()

{
FileStream fileStream = null;
BinaryFormatter binaryFormatter = null;
System.Object systemObject = null;
System.Object obj = new object();
lock ( obj )
{
string _contractLocate rKey = Guid.NewGuid(). ToString().Repl ace( "-", "" );

string fullPath = @"\\MyMachineIP \SharedDrive" + "\\" + _contractLocate rKey + ".dat";
try
{
fileStream = new FileStream( fullPath, FileMode.Create New, FileAccess.Writ e );
binaryFormatter = new BinaryFormatter ();

systemObject = new object();
systemObject = "Hello this is testing1";
binaryFormatter .Serialize( fileStream, systemObject );

systemObject = new object();
systemObject = "Hello this is testing2";
binaryFormatter .Serialize( fileStream, systemObject );
}
// catch(Exception ex)
// {
// avoided for getting noticed what happened;
// }
finally
{
if ( fileStream != null )
{
fileStream.Clos e();
fileStream = null;
}
binaryFormatter = null;
systemObject = null;
}
}
}

please help in this matter as i am stucking in the problem from more than 3 days.

this thing is happening OK :
1. if i call this method directly on another method.
2. if i call this method in a console application .
3. if i call this method on a thread in a console application.

any help would be highly appreciated.

thanks

vishal sharma
Jun 14 '07 #1
0 784

Sign in to post your reply or Sign up for a free account.

Similar topics

3
5099
by: Gerhard Swart | last post by:
Hi all. I'm writing a queue browser that reads queues from a specified machine and then display the data that's on the queue. I am using the MessageQueue Class in .Net(C#). I get the problem that I can't read the journal private queue on a remote machine. I don't know if this is possible though. I have tried all the possible options but can't seem to get it to work. The code that I tried is: MessageQueue _mq = new MessageQueue(...
0
3922
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2 development client. Bur Its gives me following error message. I searched lots of things on net and tried on remote server but i didnt got suceess. Can any one tell me how to set TCP\IP connection protocol on server for particular instance. Becuase I think
5
24016
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2 development client. Bur Its gives me following error message. I searched lots of things on net and tried on remote server but i didnt got suceess. Can any one tell me how to set TCP\IP
1
17551
by: Mr. Beck | last post by:
Hello, Please Help..... I have been working with some tcp/ip socket communication within a C# program recently. Basicly, I have a program (myProblemProgram) that has a socket connected to another program for information passing. Upon receiving a particular "command" from the the information passing program, myProblemProgram will launch a separate thread to do individual communication with another file transfer program. The thread...
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.