|
This seems like an exam question..
You can use socket communication for this purpose. There are lots of articles in CP related to this.
I wish to become a software consultant.
|
|
|
|
|
http://www.centrumxp.pl/dotNet/831,1,Komunikator_w_C.aspx
- it's in polish but hope it helps
life is study!!!
|
|
|
|
|
is there a way to set up multiple audio cards to play multiple sources separate, and together? for example, i want to set up a whole home audio system using a single computer. i want to use 3 sound cards and be able to play 3 separate audio sources to separate rooms from the single box, and if i want, combine the sound sources to play throughout the house simultaneously. is there a way to do this?
|
|
|
|
|
What does this have to do with C#? And in response to your connections yes I would think this is possible.
|
|
|
|
|
uhhh, i'd like to know how to accomplish it with c# programming? if it's possible?
i'd like to create an app that can take advantage of this, but i don't know the how to do it
-- modified at 20:28 Tuesday 8th May, 2007
|
|
|
|
|
A simple Google search would have resulted in this[^] article.
|
|
|
|
|
This may be lower level than what you're looking for, but you can use the managed version[^] of DirectSound to send waveform data to your soundcards.
|
|
|
|
|
Hi,
Can any one tell me, how to copy the tables from one database to another? and how to create database in MySQL at runtime?.
Gopal.S
|
|
|
|
|
Gopal.S wrote: how to create database in MySQL at runtime
A quick web search brings up this result[^].
|
|
|
|
|
I am coding a "Trace" object. This object will report the "method name" of the method within the class that the code is currently executing. I do not want to have to type in the method name each time the trace object is called. I simply want to determine tha nem of the method call that is currently being excecuted. How Can I accomplish this?
"Moose Man"
|
|
|
|
|
Doing a stack walk is not the fastest thing on Earth, but you could use the System.Diagnostics.StackTrace class for that.
|
|
|
|
|
Please don't repost questions so soon after you have asked it originally. You asked this question once today already - give people a chance to answer before you do it again. It's only polite.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I want to invoke DsmSetLoadBalancePolicy through WMI; whatever I try, it gives me in valid parameters.
Could someone please help me here.
Regards,
DJ.
|
|
|
|
|
Just to add to it, I am using C# (may be its obvious ).
|
|
|
|
|
Show us how you're trying it. Also, have you looked at the System.Management.dll included in the .NET framework?
|
|
|
|
|
I am already using System.Management
This is what I am doing.
- Read the current load balance policy of the lun we are interested in
- create new ManagementBaseObject from this object
- Use this close as parameter to the invoke method.
I think creating a clone may not be a good diea but I am not sure how to create a ManagementBaseObject of a specific class type.
Following is the code snippet for your reference.
int ChangeLoadBalancePolicy(string szLunName, uint uiLbPolicy, List<ulong> lu64PathIds)
{
try
{
string szScope = "\\\\localhost\\root\\WMI";
ManagementClass deviceInfo = new ManagementClass( szScope,
"MYDSM_QueryLBPolicy",
null);
ManagementObjectCollection deviceCollection = deviceInfo.GetInstances();
ManagementBaseObject policyObj;
// Get the LB Policies for each device
// and for each device create associated DSM Path objects
foreach (ManagementObject device in deviceCollection)
{
string szInstanceName = device["InstanceName"].ToString();
// if found the instance
if (szInstanceName.Equals(szLunName))
{
ManagementBaseObject lbPolicy = (ManagementBaseObject)device["LoadBalancePolicy"];
policyObj = (ManagementBaseObject)lbPolicy.Clone();
ManagementBaseObject[] dsmPathList = (ManagementBaseObject[])lbPolicy["DSM_Paths"];
ManagementBaseObject[] inDsmPath;
inDsmPath = new ManagementBaseObject[dsmPathList.Length];
int i = 0;
// For each Path, get the adapter info, which has the path info
foreach (ManagementBaseObject dsmPath in dsmPathList)
{
//ManagementBaseObject mPath;
inDsmPath[i] = (ManagementBaseObject)dsmPath.Clone();
inDsmPath[i]["DsmPathId"] = (ulong)dsmPath["DsmPathId"];
inDsmPath[i]["Reserved"] = 1;
inDsmPath[i]["PathWeight"] = 0;
bPathSelected = false;
// If DSM path id is slected as a part of the change policy request
// mark it as primary path.
foreach (ulong u64PathId in lu64PathIds)
if (u64PathId.Equals((ulong)dsmPath["DsmPathId"]))
{
dsmPath.SetPropertyValue("PrimaryPath", 1);
inDsmPath[i]["PrimaryPath"] = 1;
bPathSelected = true;
m_Log.WriteEntry(dsmPath["DsmPathId"].ToString() + " is selected");
}
if (!bPathSelected)
{
dsmPath.SetPropertyValue("PrimaryPath", 0);
m_Log.WriteEntry(dsmPath["DsmPathId"].ToString() + " not selected");
inDsmPath[i]["PrimaryPath"] = 0;
}
i++;
}
// Preparing the in parameter
policyObj["LoadBalancePolicy"] = uiLbPolicy;
policyObj["Version"] = 1;
policyObj["Reserved"] = 1;
policyObj["DSMPathCount"] = inDsmPath.Length;
policyObj["DSM_Paths"] = inDsmPath;
ManagementClass policyInfo = new ManagementClass(szScope, "MYDSM_SetLBPolicy", null);
ManagementObjectCollection lunCollection = policyInfo.GetInstances();
foreach (ManagementObject lun in lunCollection)
{
if (szLunName.Equals(lun["InstanceName"].ToString()))
{
// Method Options
InvokeMethodOptions methodOptions = new InvokeMethodOptions();
methodOptions.Timeout = TimeSpan.FromMinutes(1);
ManagementBaseObject tinParams = lun.GetMethodParameters("DsmSetLoadBalancePolicy");
tinParams["LoadBalancePolicy"] = (ManagementBaseObject)policyObj;
ManagementBaseObject outParams = lun.InvokeMethod("DsmSetLoadBalancePolicy", tinParams, methodOptions);
return (int)outParams["returnValue"];
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
|
|
|
|
|
OKAY!.
Finally the problem solved and lesson learned.
What I was doing is sending a "ManagementBaseObject" object as in parameter but the InvokeMethod expects it to be a "object" type.
So I copied the "ManagementBaseObject policyObj" into a "object tempObj" by
tempObj = policyObj.Clone();
And now instead of doing,
tinParams["LoadBalancePolicy"] = (ManagementBaseObject)policyObj;
I did,
tinParams["LoadBalancePolicy"] = checkObj;
This works fine.
Regards,
DJ.
|
|
|
|
|
Greets all
Can anyone tell me how to apply the SeDenyInteractiveLogonRight right to an account in C#, preferably using the DirectoryEntry class?
Thanks
ccitt
|
|
|
|
|
Hi every one,
I have some questions in c# and i'd appreciate any help with this concern.
1)I can't find the splash screen option in the properties of the project and i could'nt add it from add new item dialog box, so how can i add a splash screen??
2)I need to have a database (ms access) in my application, how can i create the setup for my application that includes the database and other resources such as some .swf files??
3) can i convert an image (say .jpeg) to an icon (.ico) using the Icon class?? How??
Thanks in advance to all..
|
|
|
|
|
r_jaz wrote: 1)I can't find the splash screen option in the properties of the project and i could'nt add it from add new item dialog box, so how can i add a splash screen??
In C#, you have to create a splash screen out of a form, then call it as the startup form.
r_jaz wrote: 3) can i convert an image (say .jpeg) to an icon (.ico) using the Icon class?? How??
Just use a bitmap and save it in an icon format, like so:
Bitmap bmp;
bmp = new Bitmap(@"C:\Image.png");
bmp.Save(@"C:\Icon.ico", System.Drawing.Imaging.ImageFormat.Bmp);
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
2- Create a new Setup and Deployment -> Setup Project from the File->New->Proect and create your folders, choose what to add into your folders.
NOTE: Better if you use Sql Server Express Edition 2005 (free and better than MS Access)
|
|
|
|
|
hi i done a windowns application with msaccess as database
i want to create a set up file how can i create set up file in .net 2003
i want to install all files at perticular location in harddisk
srikanth_2ma2
|
|
|
|
|
File|Add|New
Expand "Other Project Types"
Select "Setup and Deployment"
Select "Setup Project"
Give it a name, click OK
|
|
|
|
|
I tried this:
<br />
System.IO.DriveInfo[] allDrives = DriveInfo.GetDrives();<br />
<br />
foreach (DriveInfo d in allDrives)<br />
{<br />
if (d.IsReady == true & d.DriveType == "Removable")<br />
{<br />
listBox1.Items.Add(d.Name);<br />
}<br />
}<br />
...and it did not work.
I'm getting a headache. How do I accomplish what I'm trying to do?
|
|
|
|
|
What type of error did you receive? Your if statement is incorrect. Your if statement should contain && not &. This may be a typo but add another & and see what happens.
Nathan
|
|
|
|