|
Hi Abdul,
If you open your project properties, and look in the "publish" section, you can find settings for all of this (required assemblies etc etc).
Click Once enables you to create a bootstrapper that will install additional software, either from the server you are hosting the application on, or from the vendors homepage.
Hope this helps,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
hi,
Lets say i have a class named 'MyClass'. This class contains a field, 'Key', that behaves like a PK for all of the class instances, means that only one instance can have the value X for this 'Key' field.
Now i need to serialize this class and transfer it, but if the other side already has a 'MyClass' instance with the same 'Key' value i get two instances contains the same 'Key' field value... Problem.
ideas?
thanks
|
|
|
|
|
Hi,
two ways to solve this:
1.
you allow identical keys on different machines; then you have to decide what must happen when a key clash occurs (e.g. local one wins; incoming one wins; both instances get merged somehow; ...) That becomes a functional spec.
2.
you do not allow identical keys on different machines. Make your key generator such that it cannot happen. simple example: give each machine a range of non-overlapping available keys. For up to 16 machines: assign a number N in [0,F] to each machine, and make sure each key (looking at it in hex) ends on the machine number N (so 16*sequentialNumber+N).
|
|
|
|
|
The key is intentionally the same, so the second idea is out.
The first idea seem to be good but i feel i miss a much easier solution like changing the deserialization behavior...
Is there is a way to cause the deserialization process to return an existing instance instead of creating a new one?
thanks.
|
|
|
|
|
I don't know.
|
|
|
|
|
Going off the previous response, you could generate a key using a GUID or something similar derived from the MAC address.
|
|
|
|
|
Hey guys,
I was wondering if there was a way to listen for specific keys from another application.
Before anyone jumps to conclusions (that's usually the case with these types of questions, lol), I'm playing a game and I would like to re-map some controls.
For example, whenever I press keystroke 'A', I want the application to process the keystroke, and send keystroke 'B'. It doesn't matter if the game actually receives 'A' AND 'B' (the original 'A' from the keyboard input).
I'm comfortable with reading the keys and using windows API to send keys too, but my problem is that the form actually needs to be active, but that wouldn't be the case when I'm playing the game.
So... I guess the question comes down to... Is it possible to have a Windows Forms Application to perform tasks in the background while another application is active?
This would be a work-around of creating a windows service JUST FOR THIS which I really would want to avoid since I just want something really simple done... lol
If anyone has some clues/info, I'd really appreciate it.
Thanks!
|
|
|
|
|
I don't know if Processing Global Mouse and Keyboard Hooks in C#[^] is of any use in your situation, but It could give you some ideas, if nothing else.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'll check it out. Thanks Henry!
|
|
|
|
|
I used a hook to listen for keyup/down system wide in this[^] article - it may be of use to see the principle in action.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi
i've installed ssrs in my sql server database machine (with xp sp2)
but when i go to this link : http://localhost/reports i got this error :
The report server is not responding. Verify that the report server is running and can be accessed from this computer.
i tried this 2 links, but still i got the same error :
http://technotes.towardsjob.com/sql-server/troubleshooting-ssrs-error-the-report-server-is-not-responding/
http://sanjaysainitech.blogspot.com/2009/03/error-report-server-is-not-responding.html
Note : in second link i don't know how to give permisson to my account in .config files. maybe that's my problem
any help ?
|
|
|
|
|
I do not see where this has anything to do with c#.
You may get lucky and receive a good answer, but I would have thought that this question really belongs in the General Database forum.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hey budyies i wanted to access(insert datas in to) a listview item in one of my other forms ........... while the form that contains the listview is running(lets say it FormListView ) and the other form is still running @ the same time(lets say FormSender ) ......... I wanted to read a data from the listview in the FormSender and send it back to the FormListView ......... even if I make the Modifier Property of the FormListView as Public I cant call it like this from the FormSender
FormListView.listView1.Items.add("xxxx");
but I can access variables that are declared like this ....
Public static string x;
I can access by writing this code with out creating its instance
FormListView.x="xxxxx";
Please help me.
Thank you
|
|
|
|
|
I'd create public or internal Add and Read methods on the FormListView (keeping the ListView 's access modifier private).
When you create the instance, hold it in a field
public class FormSender
{
FormListView formListView;
void MethodThatInstanciatesFormListView()
{
formListView = new FormListView();
formListView.Show();
}
void ReadData()
{
List<Data> data = formListView.Read();
}
void AddData(Data data)
{
formListView.Add(data);
}
}
public class FormListView
{
public List<Data> Read()
{
}
public void Add(Data data)
{
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
DaveyM69 wrote: List data
what does the "List " and "<Data>" refers to....sry I have no idea abt that ... but I will try it .... and 1 more question.
DaveyM69 wrote: void AddData(Data data)
what data type is this "Data "
Thank you for ur help.
|
|
|
|
|
matiIsGreat wrote: what data type is this "Data"
Change it for whatever class/struct you are using to hold the data you are wanting to pass to formListView
matiIsGreat wrote: List
You don't have to use a List<T> , but it's a useful way of having a collection of whatever T is in one object. Clickety[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
The only sane way to do this, is to set up delegates so that the code that decides the form needs filling, can call a method in the form to fill it with data.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Even if i worked simple applications on c# 4 a year .... i didnt use delegates .... so i have no idea abt them ......... so can u show me sth hw to work on ma problem .
Thank you
|
|
|
|
|
two remarks on top of the fine answers you've got:
1. forms don't "run", they exist, and they may or may not be visible, have focus, etc.
2. "static" seldom is the solution; it is useful to create variables that exist only once per class instead of once per instance, e.g. when a class wants to count how many instances got created. Nothing else.
|
|
|
|
|
I am using the followijg code to send email trough my Gmail account but I am having two problems, first it's taking long time to send the email and second the From is showing as my Gmail account not the user email specefied in the txtEmail
private void btnSend_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
txtEmail.Enabled = false;
txtMessage.Enabled = false;
btnSend.Enabled = false;
btnClose.Enabled = false;
if (radioSuggestion.Checked == true)
email_subject = "Suggestion from (My System) user";
else if (radioBug.Checked == true)
email_subject = "Bug Reported by (My System) user";
else
email_subject = "Email from (My System) user";
if (SendMail("myGmailAccount@gmail.com", "xxxxxxxxx", txtEmail.Text, "myHotMailAccount@hotmail.com", email_subject, txtMessage.Text))
{
MessageBox.Show("Message Sent.", "Email", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Cursor = Cursors.Default;
this.Close();
}
else
{
MessageBox.Show("unable to send your email!!", "Email", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtEmail.Enabled = true;
txtMessage.Enabled = true;
btnSend.Enabled = true;
btnClose.Enabled = true;
this.Cursor = Cursors.Default;
return;
}
}
public static bool SendMail(string gMailAccount, string password, string from, string to, string subject, string message)
{
try
{
NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password);
MailMessage msg = new MailMessage();
msg.From = new MailAddress(from);
msg.To.Add(new MailAddress(to));
msg.Subject = subject;
msg.Body = message;
msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = loginInfo;
client.Send(msg);
return true;
}
catch (Exception)
{
return false;
}
}
modified on Saturday, September 5, 2009 2:56 PM
|
|
|
|
|
Hey budy .... even if i had no answer 4 u please make ur code more stylish so that others read it and give an answer ............ use code block
|
|
|
|
|
noted..
waiting for a reply..
|
|
|
|
|
hope u r now getting ideas..... c z difference
Good Luck
|
|
|
|
|
matiIsGreat wrote: hope u r now getting ideas..... c z difference
Please use proper words in your answers. "u r" means nothing, similarly "c z" could be written by a monkey. If you expect the questioners to put their questions in clear English then the least you can do is answer in a similar vein! Try and act as if you are at least aspiring to professionalism.
|
|
|
|
|
Thanks for reformatting your code. The change in the From field is probably because Google's SMTP server is changing the email headers mid-stream. The delay could be almost anywhere. My guess is that you're trying to send a very large email. The SmtpClient.SendAsync might help you with that problem.
|
|
|
|