|
My native dll is in fact an AutoCad arx (dll) and I get some very strange compile errors when adding CLR.
_____________________________
...and justice for all
APe
|
|
|
|
|
Oh "very strange"... well that certainly clears that up.
led mike
|
|
|
|
|
hello , how to convert wavefile to mp3 with options like bitrate,channel etc in c#.net?
|
|
|
|
|
An exe generates a myexe.exe.cfg file by default.
However, if I add a app.config to a dll it does not generate a similar file.
I would like my control (derived from Label) to have it's own key/value configuration file.
Thanks
Phil
|
|
|
|
|
|
You may also find this article useful http://www.codeproject.com/useritems/CustomConfigurationMgr.asp?msg=1930993&mode=all&userid=16070#xx1930993xx[^]
As well as my comments to it
public class MyAssembly
{
public string GetValue()
{
System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(this.GetType());
ExeConfigurationFileMap map = new ExeConfigurationFileMap();
map.ExeConfigFilename = System.IO.Path.GetFileName(asm.CodeBase) + ".config";
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
return config.AppSettings.Settings["TestKey"].Value;
}
}
In Windows or web app
MyAssembly asm = new MyAssembly();
string value = asm.GetValue();
only two letters away from being an asset
|
|
|
|
|
Hello friends
namespace calculate
{
public delegate void Startdelegate();
public partial class Form1 : Form
{
// custom event
public event Startdelegate StartEvent;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int result = int.Parse(num1.Text) / int.Parse(num2.Text);
MessageBox.Show(result.ToString());
}
private void button2_Click(object sender, EventArgs e)
{
int result = int.Parse(num1.Text) + int.Parse(num2.Text);
TextBox3.Text = result.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
int result = int.Parse(num1.Text) * int.Parse(num2.Text);
MessageBox.Show(result.ToString());
}
// our custom "Startdelegate" delegate is assigned
// to our custom "StartEvent" event.
StartEvent += new Startdelegate(OnStartEvent);
public void OnStartEvent()
{
MessageBox.Show("I Just Started!");
}
I want when the for calculation be open,Another window will be open with this maassage : " It is started"
I want to do this by delegation...
GOOD LUCK!
|
|
|
|
|
Why not use the Load event on a form for this?
|
|
|
|
|
Hi All! I'm using "Microsoft CDO For Exchange 2000 Library" along with Microsoft ActiveX Data Objects 2.5 Library to send mails using Exchange server. I've tried running the code with all possible ammendments but to no avail. I always get the "Could not find the Sender's mailbox"
error.My code is given below.
CDO.Message iMsg = new CDO.Message();
CDO.Configuration iConf = new CDO.Configuration();
ADODB.Fields Flds = null;
try
{
Flds = iConf.Fields;
Flds["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value = 3;
Flds["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value = "<220.220.220.91>";
Flds["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value = "Nitin.Vij";
Flds["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value = "common";
Flds["http://schemas.microsoft.com/cdo/configuration/smtpserverport"].Value = 25;
Flds["http://schemas.microsoft.com/cdo/configuration/MailboxURL"].Value = "http//Exchange/Exchange/Nitin.Vij/Inbox";
Flds.Update();
iMsg.Configuration = iConf;
iMsg.MimeFormatted = false;
iMsg.AutoGenerateTextBody = false;
iMsg.To = "Nitin.Vij@Domain.com";
iMsg.Subject = "Test mail from Nitin";
iMsg.Sender = "Nitin.Vij@Domain.com";
iMsg.TextBody = "Test";
iMsg.Send();
Console.ReadLine();
}
catch(Exception ex)
{
Console.WriteLine(ex);
}
Any help is highly appreciated.
Don't Quit
|
|
|
|
|
Hi,
It basically uploads the data from inside the files into sql server 2005 and then moves files around on the network.
At present I have this function inside a button in a .net 2.0 win application.
This functionality will have to be scheduled to run either every few minutes or as of when there are files on the network (To be decided later).
I am thinking that may be it is best to create a windows service for this task. What do you think?
I am also using sql server 2005.
Do you think I should use windows service in .net 2.0? #
Is there a functionality in sql server 2005 for this kind of functionality?
Thanks
|
|
|
|
|
Hello, I have a combobox that I popullate as follows:
combobox.DataSource = dataset.Tables["Table"];
combobox.DisplayMember = "name_field";
combobox.ValueMember = "id_field";
It works great, and the next step is trying to modify the displayed value directly in the combobox.
The idea is to modify the value of the name_field field in the dataset, and save it lately in the database.
I try to write directly in the combobox to modify the displayed name of the item, but as soon as I select another item, I can check that the previously selected item still has the value it used to have.
How can I make the changes permanent in the dataset?
Thank you very much.
|
|
|
|
|
It looks like on combobox selected index changed event, you are will be binding the old data again from DB ? Can you post the selected index changed event of that combo ?
|
|
|
|
|
I am doing nothing in this event.
Should I do something? I thought it would automatically update it by itself, like when I use a databindings.add(new binding...) in a textbox, in example. In this case, the only thing I have to do to have my datareader updated is to chanche the currentposition of the bindingcontext, but with the combobox it is not working at all.
Any ideas?
|
|
|
|
|
I’m trying to load a sprite into my form and move it with the cursor keys. I have added:
private Bitmap player; (player is my sprite name and has been added as a resource)
This is at the top of my file. I have then added the code to move the sprite:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Left:
player. **** Problem is here ******
After the player. I am trying to get intellisense to offer me the .left option which I then want to add:
player.left--;
I have tested a similar functionality using a picturebox1 which I just stuck on my form and was able to move this using the code above. Am I missing something to do with loading my sprite in, as the picture box was already on the form and i managed to move this using the code above?
Here’s the code in full:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Media;
namespace Game
{
public partial class Form1 : Form
{
// insert private bitmap background
// and movement int x/y move etc.....
private Bitmap background = new Bitmap(640, 320);
//private Bitmap car;
private Bitmap player;
public Form1()
{
InitializeComponent();
player = new Bitmap(GetType(), "player.jpg");
//car = new Bitmap(GetType(), "car.jpg");
Bitmap background = Game.Properties.Resources.background;
this.BackgroundImage = background;
SoundPlayer sndPing = new SoundPlayer(@"c:\lee\traffic.wav");
sndPing.Play();
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Left:
player.
}
}
}
}
Thanks
|
|
|
|
|
player is a Bitmap[^] object, and as you can see from the members[^] it has, Left is not one of them.
lee.hallows wrote: I have tested a similar functionality using a picturebox1 which I just stuck on my form and was able to move this using the code above
That is because a picturebox is a control and has a location on the form. A bitmap is just an image representation.
Perhaps if you assigned the bitmap to the picturebox and moved the picturebox you would get the functionality you desire.
[ADDITIONAL]
Also, if you are programming a game you may find it more advantageous to use XNA Game Studio Express which is designed for the purpose. It is a free download from Microsoft and it will provide better functionality for writing games than plain Visual Studio.
[/ADDITIONAL]
|
|
|
|
|
Hi,
I have Created One Windows Application , it have one Post Operation ,When any data is posted It will inserted to Database.I have Installed My application to many systems.When any Data is Posted I want To give Alert To All Systems?How can I give the Alert To All the Systems?I s this is possible or not?Please Any one help me.......(I have Only one Server and Many clients)
**Is any Data is posted ,How can I give the Alert To All Systems.....?
|
|
|
|
|
Hi,
You can send some sort of message to the clients. By 'message', I mean, some custom class object or a simple string denoting that the event has occured on the server. Then the client can display the object recieved from the server in any form ( as you might want it to be displayed ). By the way how are you connected to the server ? Using sockets ?. If yes then just send string of data to all clients when the event occurs on the server and the client should be able to interpret the string.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thanks for ur reply.
Is there any article u have please send me the link....I have used normal database connection..(SQL connection).When any data is added in the database ,I want to give alert message to all login users.Please help me
|
|
|
|
|
hi all,
I am developing a windows application where i have included code for online update of my application.When i am trying to download the files from the server, I am able to download all the files except exe file.
Could anybody tell me how to download a exe file from the server?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Maybe your virusscanner or firewall is blockig exe files. Essentially thee is no difference between different types of datafiles.
|
|
|
|
|
Hi.
What is the easiest way to synchronize two(or more) threads in the classic producer-consumer problem?
What classes and mechanisms must be used? Does .NET Thread object have features similar to Java threads? (wait, notify, notifyAll methods)
Some code snippets would certainly help.
Thanks.
|
|
|
|
|
Google is your friend.
[^]
|
|
|
|
|
hi,
i want a combo with the ok and browse button ..
browse i should browse the files and i can say ok
pls help me
with regards
prasad
|
|
|
|
|
during the form load event, say
ComboBox1.Items.Add("Ok");
ComboBox1.Items.Add("Browse");
Then use the following code
if(ComboBox1.Text=="Browse")<br />
{<br />
<br />
OpenFileDialog ofn = new OpenFileDialog();<br />
ofn.Filter = "XML Files (*.xml)|*.xml";
ofn.Title = "Type File";<br />
if (ofn.ShowDialog() == DialogResult.Cancel)<br />
goto Quit;<br />
}
i hope this helps/
Keshav Kamat
India
|
|
|
|
|
hi,keshav
u r adding a text wright and it is not working..
i think my question was not clear
i am having a datagrid and one of the column is made as a
column type=DataGridViewComboBoxColumn
and i am adding a rows like
Scenario_Designer_gridview.Rows.Add(filename);
where filename contains the list of files in a specifeid folder i am getting from folder browser.
now i want add the list of files to a that column...
i am getting error......
help me pls.
|
|
|
|