|
sorry , i tryed the link i found it dont work (i dont know why)
anyway , go to
MSDN Forums » .NET Development » .NET Framework Networking and Communication » problem in client/server application
start the navigation from this link:
http://forums.microsoft.com/msdn[^]
i know this problem , its boring
sorry again
|
|
|
|
|
Well, his problem is kind of different. His computers can see each other on a network, mine can't.
But I got something here. I disabled both the Windows Firewall and PeerGuardian and guess what, Apache works. I tried my program but nope, that doesn't work yet. But wait a minute... 'telnet 192.168.0.100 77 ' gets through! Then how come my client doesn't?! I updated the code:
IPEndPoint ep = new IPEndPoint(IPAddress.Parse("192.168.0.100"), 77);
sock = new TcpClient(ep);
But it still isn't working... Ideas? Thanks for helping me!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Nevermind, that wasn't supposed to work. But this is:
sock = new TcpClient();
sock.Client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
sock.Connect(host, 77);
Wee, now I can play in 2 computers. Thanks VERY much!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Hello there,
I need to connect internet via C# using dialup. I can dialup existing dialup connection using wininet API but I wonder some body tell me how can we pass userid,password n dialup number at runtime. It would be appreicated please...
Best Regards,
Yousuf
|
|
|
|
|
Hi everyone .. hows life goin with you .. !!
well ... i have a bluetooth project .. and i searched codeproejct for bluetooth related articles .. and found "Bluetooth Manager" .. the article was simply GREAT ... and the included library was more than GREAT .. so I downloaded the libraries and the code ... built it ... then when I started using it .. specially the function "DiscoverDevices()" ... it gave me the following exception :
PlatformNotSupportedException
and it says : Bluetooth.Net is not supported on this device.
i was like this : ... I mean how .. ? .. i use my bluetooth device ... dongle .. without any problem ... trasferring files ... between the PC and my nokia6600 and other mobile phones ... !!
but this problem is just confusing me ... i searched and found out that bluetoosh stack must be installed or something .. I guess bluetooth stack is a service or something ... but I didn't find the service in (Control Panel -> Administrative Tools -> Services)
i'm really confused .. this is the first and hopefully the last problem i might face .. then everything will be clean n clear ... !!
I'm using MS Visual Studio .NET 2005 ... Dongle USB Bluetooth device ... MS Windows XP Home & Pro .. both SP2 .. libraries are :
InTheHand.Net
InTheHand.Net.Bluetooth
InTheHand.Net.Sockets
InTheHand.Net.IrDA //i know this is for infra red but i added it n dunno why :P
anyone have tried or worked on a bluetooth project or tried searching and discovering devices ? then sending files and other operations .. ??
sorry for the long message ... but this is serious for me .. !!
thanks a lot in advance .. !!
|
|
|
|
|
Hi.
Can anyone introduce me some articles about multi-tire architecture (with sample)?
Best wishes
|
|
|
|
|
You mean multi tier. Now you know how to spell it, I'm sure you'll find heaps through google
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi every buddy,
Well I was thinking abt building some kind of a mechanism that gives progress in a progressBar while we access some information from the Database. So the core issue is, how to get the progress information from a query while it is running on a database. Lets say you’re making a long calculation from a ledger Table
Cust_Ledger(ID, , account_ID ,CustID, Debit, credit, t_date)
And u execute the query using the SqlDataAdapter or TableAdapter or whatever the case maybe, then how can u show the progress…
Thanks in advance,
Rocky
|
|
|
|
|
You can't.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Only thing I can think of would be to break the query down and loop through the broken down bits, but it would probably have a fair performance hit, though...
|
|
|
|
|
Instead of a progress bar try another progress indicator, if your idea is showing activity to the user. Otherwise, I dont know any way of doing what you're asking.
|
|
|
|
|
|
You said you had one question but posted 3 times about the same subject.
Please don't post multiple topics, if you need to change the post, there is an edit link which allows you to make necessary changes.
May I suggest you edit or delete your previous posts.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
I am very sorry to repeat the question twice, but I want to have sat explained more I did not know that I modified
|
|
|
|
|
Why did you ask it twice then ?
I don't understand the question tho. It seems pretty basic, whatever it is. Do you mean more than one column, or more than one row ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I know it is not my right to impress you, but I have the right to benefit from the experience and I learned my question was how you can find more than one Column at the same time say, I want to look in any Column of the User chooses
-- modified at 20:14 Friday 27th April, 2007
|
|
|
|
|
Hello I Have a multithreaded windows service that receives messages from 30 different terminal servers at 1 time. I'm using threading and the threadpool object to queue the threads. I'm seeing quite a bit of a delay on important threads. Is there anyway I can change the priority in the thread pool to prevent
delays on important messages.
Jason E Cain
|
|
|
|
|
Try the property Thread.Priority, 5 levels: Highest, AboveNormal, Normal, BelowNormal, Lowest.
Jim
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
Hi,
I am creating a dynamic Type with Reflection.Emit Namespace. The created Type is derived from a BaseClass that contains some protected properties that should be used by the new dynamic Type.
Is there any other way to call a function than using
EmitCall(OpCodes.Callvirt, MethodInfo MethodToCall, Type[] Args)?
I do not have a chance to get the MethodInfo without a ReflectionPermission? MSDN says that it is needed for non public types...
Right now I use:
[...]<br />
Type[] Args = new Type[]{ typeof(...) };<br />
BindingFlags BF = BindingFlags.NonPublic | BindingFlags.Instance;<br />
MethodInfo MethodToCall = BaseType.GetMethod("MethodName", BF, null, Args, null);<br />
ILG.EmitCall(OpCodes.Callvirt, MethodToCall, Args);<br />
In addition, the TypeFactory of the dynamic Type is a static function of the BaseType - so there should be no reason, why the access to the MethodInfo is restricted.
Am I missing something?
Added April, 28th:
I tried to test with refused Permission, but I am not really experienced with System.Security.Permission Namespace. Would it be a working test to add the following Attribute to my factory function that uses the code above?
[ReflectionPermission(SecurityAction.Deny, Flags = ReflectionPermissionFlag.MemberAccess)]
I ask, because my code still works fine, but MSDN said, that it should not...
Does this mean, that the Permission is not needed?
best regards,
Bernd
-- modified at 4:33 Saturday 28th April, 2007
|
|
|
|
|
I would like to open a document as readonly regardless of which application opens it. Please find below the code the I am using to open the docs:
private void OpenDocument(string FileName)
{
try
{
// open item with associated application
Cursor.Current = Cursors.WaitCursor;
OpenDocumentProcess = new System.Diagnostics.Process();
OpenDocumentProcess.StartInfo.FileName = FileName;
OpenDocumentProcess.EnableRaisingEvents = true;
OpenDocumentProcess.Exited += new EventHandler
OpenDocumentProcess_Exited);
OpenDocumentProcess.Start();
}
catch (System.Exception e)
{
MessageBox.Show(e.Message, this.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
Cursor.Current = Cursors.Default;
}
}
TawaPower
|
|
|
|
|
Why not just use File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None) ?
I think no matter what if another process has opened the file with exclusive locks, you won't be able to access it.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
What you're doing here is starting a process not opening a file. Somewhere you need to actually open the file and there you'd specify you want open it Readonly and Shared.
GregD (My blog about software development)
|
|
|
|
|
Hello all,
I am currently using ThreadPool.QueueUserWorkItem to queue items onto the thread pool, the code I am using is relatively simple and looks something like this:
private static void StartQueue
{
StringReader sr = new StringReader(rawData);
string line = string.Empty;
while (((line = sr.ReadLine()) != null) && (this.allowQueuing))
{
ThreadPool.QueueUserWorkItem(new WaitCallback(DoMagicalThings), line);
}
}
private static void DoMagicalThings(object data)
{
Console.WriteLine(data.ToString())
}
What I need to work out is when the last item in the queue has completed processing. At first I came up with a fairly heath robinsion solution which was after the While in StartQueue I would add a null object onto the queue and then check this in DoMagicalThings and set a completed flag.
The problem here is that in the real app DoMagicalThings does alot more than just a simple console write, so I have found that in some cases the last item added to the queue is not always the last item whose execution finishes.
So the question is does anybody know how I can validate that all items I have added to the thread pool have completed
|
|
|
|
|
Keep a running count of how many threads you have going. Each time you queue up a job, increment a counter. In order to wait for all of the jobs to have completed, do something like this:
lock(lockObject)
{
while(jobCount > 0)
{
Monitor.Wait(lockObject);
}
}
And in each of threads, do this:
private void ThreadJobProcedure(object data)
{
lock(lockObject)
{
jobCount--;
Monitor.Pulse(lockObject);
}
}
|
|
|
|
|
That looks like it would do what I need, however considering I am a bit thick I am not sure what to use as the lockObject. Using the example in my first post the code has changed to something like this:
private static void StartQueue
{
StringReader sr = new StringReader(rawData);
string line = string.Empty;
int jobCount = 0;
while (((line = sr.ReadLine()) != null) && (this.allowQueuing))
{
ThreadPool.QueueUserWorkItem(new WaitCallback(DoMagicalThings), line);
jobCount++
}
lock(lockObject)
{
while(jobCount > 0)
{
Monitor.Wait(lockObject);
}
}
Console.WriteLine("All done");
}
private static void DoMagicalThings(object data)
{
Console.WriteLine(data.ToString())
lock(lockObject)
{
jobCount--;
Monitor.Pulse(lockObject);
}
}
An additional problem is that externally to this a user could click a Stop button, this should stop all threads and stop any further items being processed. Could I somehow use this Lock and Monitor functionality to do this?
In my original code, I had a simple class var bool that would be checked at the top of the worker method. If the value was false then the worker method would immediately return
|
|
|
|