|
Hi!
No, it's not possible.
A socket is a socket, a stream is a stream.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Socket is not a stream but you can get underlying stream of socket using this code:
NetworkStream ns = Socket.GetStream();
rizwanSharp;
|
|
|
|
|
I have been fooling around with unit-tests, and I was wondering if there is a good way to unit-test if events get fired properly? And is it wise to test these?
I think it's smart to test them, since you want to be as complete as possible when unit-testing.
WM.
What about weapons of mass-construction?
-- modified at 8:41 Sunday 23rd July, 2006
|
|
|
|
|
Yes its very easy atleast if you use .net 2.
you can do things like this:
public void MyTest<br />
{<br />
ClassToTest klass = new ClassToTest();<br />
bool eventFired = false;<br />
klass.SomeEvent += delegate { eventFired = true; };<br />
klass.DoStuff();<br />
<br />
assert.IsTrue(eventFired);<br />
}
This might look impossible at first sight since "eventFired" seems to be out of scope in the delegate.
However , the c# compiler is kind enough to do some magic for us , packing our bool in a dispatch class.
so it works very well and Im using it all the time.
//Roger
|
|
|
|
|
Duh, I did forget anonymous delegates existed
Thanks for the info, this should solve the problem.
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi,
I want to let my programme run in some PC without FrameWork,so i want in my Install Project,Automatic check the system if FrameWork installed,if not,it can install it but not from internet,i want to intergrate it in my Install file,how can i did this?thanks for answers~~
|
|
|
|
|
There is no merge module for hte framework, you have to ship the framework installer and run it from your install program.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi.
I want to do some works with a picture and need to work with pixels.
but the getpixel(,),setpixel(,,) functions in a loop are very slow.
is there a way to get or set pixels faster.
my code is like this:
Bitmap myBmp = new Bitmap("filename");
Color p = new Color();
int i,j;
for(i=0 ; i < myBmp.Width ; i++)
{
for(j=0 ; j < myBmp.Height ; j++)
{
p = myBmp.GetPixel(i,j);
if(p.R <= 250) p.R += 5;
if(p.G <= 250) p.G += 5;
if(p.B <= 250) p.B += 5;
myBmp.SetPixel(i,j,p);
}
}
erfan
-- modified at 8:01 Sunday 23rd July, 2006
modified on Thursday, February 12, 2009 5:07 AM
|
|
|
|
|
Hi!
Just use the search function to find Christian Grauss' excellent articles on image processing.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
thanks
what is the article's name?
|
|
|
|
|
My answer was that there are articles here on CP telling you how to solve your problem, you just have to search!
If you're unable to find the search button, you can try this page instead.[^]
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
This[^] article is the first of several.
/ravi
|
|
|
|
|
1.i write a windows service,open a other application,but the process is run,application is not open,the same code in a winfrom project is not any question.the code of open other application is simple:
Process myProc = new Process();
myProc.StartInfo.FileName = strUrl;
myProc.StartInfo.CreateNoWindow = false;
myProc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
myProc.Start();
strUrl is other application's path,it's right!
2.how to write uninstall windows service code in setup project ,i know command "installutil servicename.exe" can uninstall windows service,but setup project can't use command,can you tell me how to write a unstall project and put the project into setup project's unstall custom action?
Thank you very much!
|
|
|
|
|
1. A windows service usually doesn't have access to the windows desktop and an application started by the service won't have access to the desktop, either.
Most likely this is the reason why the application is not running.
2. Add an Installer to your service, then you can run this Installer as a custom action during your uninstall.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
thank you!
i geted the answer of my second question:override Uninstall method in windows service projectinstaller.cs file,in this method write a process.start() ,process.fileName="path\\installutil.exe /u path\\serviceName",when application uninstall,the windows service will be uninstalled.
first question,i selected the serivce propety of "allow the windows desktop",but the application only run a process,have not desktop UI.
i will try and test again!
thank you again!!!
|
|
|
|
|
i wanna ask about the ability to connect sql server 2000 database files
without installing sqlserver 2000 itself but i'm hearin about MS desktop engine can give me this ability with coding using my application is this true or not?
|
|
|
|
|
Do not cross post. I already answered you in the SQL forum[^]
|
|
|
|
|
Hi,
I have a form with multiple textboxes that are bound to a dataset.
When a user changes the content of the textbox how do I get those changes passed back to the database with a "save" button click?
Glen Harvy
|
|
|
|
|
In .NET 2.0 you get use generated table adapter code and call Update on it and pass the dataset as arg. But sounds like you could use a bit of reading on the dataset and ado.
Wout
|
|
|
|
|
Only got 1.1 .
How do you do it in 1.1?
Glen Harvy
-- modified at 7:53 Sunday 23rd July, 2006
|
|
|
|
|
here is an example of doin this in .net 1.1
we got two col in this form textBoxBankID and TextBoxBankName. I hope this should solve ur problem
DataRow dr = accounts1.Bank.NewRow();
textBoxBankID.Text = ((decimal)accounts1.Bank.Rows[accounts1.Bank.Rows.Count-1]["BankID"]+1).ToString();
sqlInsertCommand1.Parameters["@BankID"].Value = bID = Convert.ToDecimal(textBoxBankID.Text);
sqlInsertCommand1.Parameters["@BankName"].Value = textBoxBankName.Text;
dr["BankID"] = bID;
dr["BankName"] = textBoxBankName.Text;
accounts1.Bank.Rows.Add(dr);
int n = sqlDataAdapter1.Update(accounts1,"Bank");
MessageBox.Show(n.ToString());
accounts1.AcceptChanges();
// write code to refresh the dataset
//as ds.Clear();
//da.Fill(ds,"Bank");
Rocky
|
|
|
|
|
Are u suggesting that I create a new dataset with the data that I want to be displayed to the user by filling it with the data from the various related tables?
As far as reading material is concerned - what do u suggest? I have searched the net extensively and have purchased "A programmers guide to ADO.Net in C#" but I'm stll confused!!
Glen Harvy
|
|
|
|
|
Hi,
I need some example how to do it - i really don't understand how to do use invoke method in control.
Thanks.
|
|
|
|
|
Take a look through these [^]articles on CP. Don't follow my sig guidelines
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
very simple methods are in C#,
view some programms and see how it works.
http://www.engineeringproject.net
|
|
|
|