|
Swader wrote: How can I make it store all the dll in a subfolder?
Create a sub folder inside bin directory, copy dll's over there, and refer it from there.
|
|
|
|
|
So will that work the same way.. even if I were to change the location of the folder or after I deploy?
------------------------------------------------------------------
Life would have been much easier if I had the source-code!!
|
|
|
|
|
Hello, I want to set my crystal report page to required size 5 1/2 x 12 in. How can i do this. Please help me.
Sunil
|
|
|
|
|
HI to all
I have two Xmlstring whose content is from a datatable. I want to Merge the two xmlstring into one DataTable. How can I Do.
First thing is that How i can write the datatable content into a xmlString?
I am new to C#....
Regards
Burhanuddeen
|
|
|
|
|
hi,
i have two set of codes here for the same output....
one is by using the functions that i wrote and the other one is by using delegates(got form net)
can anybody tell me the advantage of using the delegates in this code??
please check the comments in the code using delegates...
i found the normal way much easier....
WITHOUT USING DELEGATES:::
using System;
using System.Collections.Generic;
using System.Text;
namespace trialfunctions
{
class Program
{
string name;
public void enter()
{
Console.WriteLine("enter a string");
}
public void display()
{
name = (Console.ReadLine()).ToString();
Console.WriteLine("The string entered is {0}", name);
Console.ReadLine();
}
static void Main(string[] args)
{
Program obj = new Program();
obj.enter();
obj.display();
}
}
}
----------------------------------------------------------
///////////////////////////////////////////////////////////
----------------------------------------------------------
USING DELEGATES:::::
using System;
public delegate void TestDelegate(string message); //Declare the delegate
class Test
{
public static void Display(string message)
{
Console.WriteLine("The string entered is {0} " , message);
}
static void Main()
{
TestDelegate t = new TestDelegate(Display); //Instantiate the delegate
Console.WriteLine("Please enter a string");
string message = Console.ReadLine(); //what is the need for this
t(message); //Invoke the delegate
Console.ReadLine();
}
}
thanking you
-- modified at 1:45 Thursday 25th October, 2007
C#
|
|
|
|
|
In this instance, the delegate is obviously pointless. Delegates are great for creatng components that can be reused, or for comunication between forms.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yesterday you have pointed that passing current form object to second form through constructor is nasty. Could you tell me why it's so ? If we use delegates also, we need to create object and hook it to a method in form1. So I don't find any differences.
|
|
|
|
|
even i thought so.....
but i wanted to check....
thanks again
C#
|
|
|
|
|
Hi,
I have a problem.Iam having one data grid which is creating dynamically.Data grid columns are also creating dynamically.In data grid iam having one template column.Which is also created dynamically.In template column iam having text box.Now the problem is
Template Column
textbox1
textbox2
textbox3
textbox4
textbox5
textbox6
if i enter some values in textbox2 and textbox3 the sum should be displayed in textbox1.Similarly for others.Please help me on this.
Veeresh.
|
|
|
|
|
When we encrypt some data with Cryptostream, we get a stream containing that data by using the CreateEncryptor method. We can store it in a file for example. Afterwards, when we want to decrypt it again we use CreateDecryptor with the same key and IV that we used for encryption.
My question is: Where are the key and the IV stored so that the decryption method makes sure that they are the same that were used for encryption?
|
|
|
|
|
I tried many ways to embed window media player in my C# page to play a song.But it didn't work properly.The song coudn't play.Almost it only work in html file.Anyone help me.
I use VS 2003,Framework 1.1.
nothing
|
|
|
|
|
|
I used WMP 10 SDK for VS 2003,Framework 1.1.Is it right ?
I wonder that WMP 10 SDK is suit with VS 2003 or not.
nothing
|
|
|
|
|
Hello everyone,
I am facing problem using FullScreen mode in Vista. Everything works fine under XP but things don't play as they should under Vista!
Here is the problem,
I have created FullScreen Toggle which simply toggles between FullScreen mode and Normal (NOT FullScreen) mode. Using the Windows Application in Xp it does as it should be, but when I use the very same Windows Application in Vista it behavious strangely.
Under Vista Operating System, the FullScreen mode works only ONCE! When I try to got o FullScreen for the second time and so on, I get the New Video Window opening but it doesn's display on my computer screen. I see a New Video Window opened in my Taskbar. since the Toggle is done by double clicking on the video screen, I can double click and get back to normal screen with my video playing!
I have search the internet for the issue related with Vista and Fullscreen mode and there has been number of different reports. But neither of the explained in detail what thier problem was and nor a fix was suggested.
Can anyone be kind enough to take me moment and let me know what is going on regarding FullScreen mode and Vista?
Thank you very much and have a great day.
Khoramdin
-- modified at 23:55 Wednesday 24th October, 2007
|
|
|
|
|
The .Net documentation for String.Contains() (http://msdn2.microsoft.com/en-us/library/system.string.contains.aspx) says it may raise the System.ArgumentNullException exception. This is the only exception listed for this method.
However, when I use this method to examine the contents of string based object properties, I'm getting the following exception instead:
System.NullReferenceException: Object reference not set to an instance of an object
Note that the exception doesn't happen unless I use the .Contains() method.
For instance, in the following code:
string myString = object.stringProperty;<br />
MessageBox.Show(myString);<br />
<br />
if (myString.Contains("a")) { ... }
no exception is thrown until the "if" statement is executed.
So, is the documentation incorrect, or is there something special about the empty string being held by the object property?
|
|
|
|
|
Have you checked myString to see if it's null or not?
Cyril Connolly wrote: Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
|
|
|
|
|
Clearly, I have not . But I'm not sure what point you are making?
Am I wrong in assuming that the list of Exceptions in the String.Contains() documentation is exclusive and complete?
|
|
|
|
|
It's not a string exception, it's a runtime exception. You're calling a method on a null object.
Cyril Connolly wrote: Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
|
|
|
|
|
I guess I'm confused why none of the other code is throwing an exception on the null object. I can pass that object to MessageBox.Show, I can add another string to it, etc. It's only when I call .Contains() that it coughs up a lung...
|
|
|
|
|
However, thanks for your help. I'll guess I'll have to be more defensive in null checking on reference values returned from properties. Dang those inconsiderate objects!
|
|
|
|
|
Are you aware of FxCop[^]? I don't know if it will identify the problem above, but I analyzed a project and FxCop found a couple of instances of not checking if an object was valid before using it.
Cyril Connolly wrote: Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
|
|
|
|
|
My application has got 3-4 solution and each solution have few projects in it. Currently all the confiugration data for my application is scattered across various project.config files in individual project.
I want to merge all these configuration settings and make a one single config file which will be accessed by all solutions / projects. If possible I would like to read/write this common file using "Properties.Settings" class as we normally read the config files.
Can any one give me idea on how to achieve the above thing?
|
|
|
|
|
I'm having an issue trying to get my clients to handle messages that are passed from a server to a shared object... Any remoting gurus out there are free to enlighten me...
Ok.. First of all, here is the interface created to by implemented by the remote object:
namespace WarComInterface<br />
{<br />
<br />
public delegate void ServerToClientEvent(object sender, ServerToClientEventArgs e);<br />
<br />
public interface ICom<br />
{<br />
Joueur clientReqJoueur(string nomJoueur);<br />
<br />
event ServerToClientEvent ServerToClientMsg;<br />
<br />
void clientMsg(EventTypes.EventsFromClient typeEvent, string nomJoueur);<br />
}<br />
}
Now, here is the part where the client gets a reference to the remote object and sets a handler to listen for events coming from the server:
<br />
try<br />
{<br />
TcpChannel channel = new TcpChannel();<br />
ChannelServices.RegisterChannel(channel, false);<br />
remoteComm = (WarComInterface.ICom)Activator.GetObject(typeof(WarComInterface.ICom),<br />
"tcp://"+txt_adrip.Text + ":1069/jh");<br />
<br />
remoteComm.ServerToClientMsg += new ServerToClientEvent(MessageFromServer);<br />
<br />
And finally, this is the part inside the shared object. It's within a public method called by the server (some sort of public void sendMsg() )
<br />
evArg = new ServerToClientEventArgs(EventTypes.EventsFromServer.UpdateStats, targetPlayer);<br />
if (ServerToClientMsg != null)<br />
{<br />
ServerToClientMsg(this, evArg); <br />
}<br />
It fires up the following exception : This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server.
Any help would be greatly appreciated!
|
|
|
|
|
I've seen that message. For me, it meant that the client was not defining a suitable channel for the event callbacks. What makes yours "unsuitable" might be the absence of a channel altogether (which I doubt, looking at your sample), permissions (which I don't understand), or the absence of the typeFilterLevel attribute for the channel. In the server's config file, the latter would look like:
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
|
|
|
|
|
Hello everyone,
How can I get the focus on a Window Form? This is my problem. I have created a Media Player using DirectShow in C# enviroment. When I use the full-screen mode and enlarge the screen after reducing the size to normal, no longer I can have any form open on the TOP of the other windows.
Thank you very much and have a great day,
Khoramdin
|
|
|
|