|
|
Shameless plug if I've ever seen one. I looked at your AdvancedTextBox a few months back and I must say I was impressed.
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
how about tring Miscrosoft's SOAP? it's a great solution, I know that it works great for client server applications, it let's you transport as much data as you want
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
how i can open a form in pc from another pc ?
if any one know that repaly me
|
|
|
|
|
You'll need a client app running on the second PC that you want to display the form on. You can't just send a form to another machine and expect it to work. You'll need another app to do it for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I want to send multicast packets on a Windows 2000 Machine with 2 Network interfaces. I want to send the multicast Packets over the Interface that is not the Interface to the default gateway. But the Packets are sent to the default gateway interface. Where is the problem?
using System;
using System.Net.Sockets;
using System.Net;
using System.Text;
namespace Mssc.TransportProtocols.Utilities
{
class TestMulticastOption
{
static IPAddress mcastAddress;
static int mcastPort;
static Socket mcastSocket;
static void JoinMulticastGroup()
{
try
{
mcastSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp);
Console.Write("\nEnter local IPAddress for sending multicast packets: ");
IPAddress localIPAddr = IPAddress.Parse(Console.ReadLine());
IPEndPoint IPlocal = new IPEndPoint(localIPAddr, 0);
mcastSocket.Bind(IPlocal);
MulticastOption mcastOption;
mcastOption = new MulticastOption(mcastAddress, localIPAddr);
mcastSocket.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership,
mcastOption);
}
catch (Exception e)
{
Console.WriteLine("\n" + e.ToString());
}
}
static void BroadcastMessage(string message)
{
IPEndPoint endPoint;
try
{
endPoint = new IPEndPoint(mcastAddress,mcastPort);
mcastSocket.SendTo(ASCIIEncoding.ASCII.GetBytes(message), endPoint);
Console.WriteLine("Multicast data sent..... " + mcastAddress.ToString());
}
catch (Exception e)
{
Console.WriteLine("\n" + e.ToString());
}
mcastSocket.Close();
}
static void Main(string[] args)
{
mcastAddress = IPAddress.Parse("224.100.0.1");
mcastPort = 11000;
JoinMulticastGroup();
BroadcastMessage("Hello multicast listener.");
}
}
}
Thanks
Roland
Wenn Du diesen Satz irgendwo liest, ignoriere ihn.
|
|
|
|
|
I found the solution myself:
With
<br />
mySocket.SetSocketOption( <br />
SocketOptionLevel.IP, <br />
SocketOptionName.MulticastInterface, <br />
interfaceAddress.GetAddressBytes() <br />
); <br />
the interface for the Multicast distribution is defined.
Greets
Roland
Wenn Du diesen Satz irgendwo liest, ignoriere ihn.
|
|
|
|
|
Hi all,
A beginners question:
I define
SqlCommand myCommand;
in a function
I then do
try<br />
{<br />
myCommand = new SqlCommand(mySelectQuery,mySQLConnection);<br />
}<br />
catch(System.Exception e)<br />
{}
I get an errormessage
Use of unasigned local variable myCommand
I see why I get the message but have no real clue on how I can use the try - catch without casting the errormessage.
regards
Stijn
|
|
|
|
|
try assigning the command a null value :
SqlCommand myCommand = null;
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Hi all,
A beginners question:
I define
SqlCommand myCommand;
in a function
I then do
try<br />
{<br />
myCommand = new SqlCommand(mySelectQuery,mySQLConnection);<br />
}<br />
catch(System.Exception e)<br />
{}
I get an errormessage
Use of unasigned local variable myCommand
I see why I get the message but have no real clue on how I can use the try - catch without casting the errormessage.
regards
Stijn
|
|
|
|
|
Some comments:
1. All too often you don't want to try/catch - a program should have way more try/finally than try/catch. If you're accessing myCommand after the catch ((System.Exception e) {}, myCommand may have not been initialized due to an exception, as you're "swallowing" exceptions on the catch. Notice that if you add a "throw;" statement to your catch, the error message goes away. Be aware that "swallowing" exceptions is a bad practice and leads to code that's hard to debug and problems hard to detect, as the problem will never happen near the real error.
2. If this doesn't solve, you can substitute SqlCommand myCommand; for SqlCommand myCommand = null;
Again, use this wisely, as you can hide exceptions and introduce subtle bugs...
Yes, even I am blogging now!
|
|
|
|
|
Hi!
I've written a windows service. This service can be in different states, for example running, paused, updating etc. To give the user a direct feedback of the services state, I want to display an icon on the windows system tray, which appears in different kind for each state......
The problem is, that the icon (System.Windows.Forms.NotifyIcon) is not displayed... but also no exception is thrown...
<br />
protected override void OnStart(string[] args)<br />
{<br />
NotifyIcon NI=new NotifyIcon();<br />
NI.Icon=new Icon(@" ... ");
NI.Text="My Service";<br />
NI.Visible=true;<br />
}<br />
Can somebody tell me, why my NotifyIcon is not displayed?
occcy
|
|
|
|
|
mabye I am wrong but i think that you should put the NI variable at the calss level. In the code exemple supplied by you NI will be removed (by the garbage colector) at the end of the OnStart function scope.
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
A service should not interact with the desktop unless unavoidable, because it could introduce some serious security issues. A sounder design would be the service "talking" to another program that displays the icon.
Don't forget that services run even when there is no desktop, i.e., when no user is logged in.
If you really must do it, there's the "allow service to interact with the desktop" checkbox on the service manager, but I strongly advise you not to use it, unless it's only test code...
Yes, even I am blogging now!
|
|
|
|
|
Okay!
That sounds plausible
Thanks!
occcy
|
|
|
|
|
Hello
I have a question about Microsoft Word events. I know it is possible to catch events cast in Word if you do something like this and start Word through your program.
oWord = new Word.Application();<br />
oWord.Visible = true;<br />
But is it possible to have a program in the "background" and when the user starts Word manually it starts to listen to the events? This sounds impossible to me, but would be nice if it was not
Thanks
|
|
|
|
|
Christer Claesson wrote:
But is it possible to have a program in the "background" and when the user starts Word manually it starts to listen to the events? This sounds impossible to me, but would be nice if it was not
Instead of this, you could write a Word macro or an addin that would call your program only when necessary. This way, your program would not even need to be in "background" all the time, only when needed.
Yes, even I am blogging now!
|
|
|
|
|
Ah, true. I've been looking around and learning about addins now and they seem to be able to do what I want.
Thanks
|
|
|
|
|
Search for "Word addin"
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
helpme
ArrayList al = new ArrayList();
foreach (TreeNode tn in tree.Nodes)
saveNode(tn, al);
}
// Datei anlegen
Stream file = File.Open(filename, FileMode.Create);
Stream file = File.Open(filename, FileMode.);
// Binär-Formatierer init.
BinaryFormatter bf = new BinaryFormatter();
try
{
// Serialisieren des bf.Serialize(file, al);
}
i have succsesful in sava file and unable to reed file help me for purpase
tankyou
|
|
|
|
|
Can you post the code you use for reading the file?
Which specific problems do you have?
www.troschuetz.de
|
|
|
|
|
Try to add the following line before serialization:
bf.AssemblyFormat = FormatterAssemblyStyle.Simple;
This will save the assembly name without the version number, allowing you to read it more easily.
If this works, you should also consider a rigid versioning on this assembly.
Yes, even I am blogging now!
|
|
|
|
|
Hi all,
There are two forms(A and B) in a MDI form container. The form A has a panel(many controls inside the panel). Can form B get the panel from the form A dynamically during its running, so as to display the panel control in form B ?
Thanks
|
|
|
|
|
The answer to your question is no, you can not show a control onto 2 separate forms in the same time... you could acces the panels data instead if you pass it as a parameter to your other form, or by any other way prefered by you...
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Hi all,
In a MDI form container, I tried to add a splitter to seperate two child forms at two different sides (left and right) but failed to do so. What I can do is to use a splitter to seperate a window control(such as panel) and a form, but not two forms, why ?
Thanks
|
|
|
|