|
Rentacoder is a good place to get your homework done, if yuo want to pass without actually becoming employable.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Rentacoder is a good place
You're just jealous of those guys
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
I want fame, fortune a ham sandwich and a big-screen TV.
/ravi
|
|
|
|
|
My mate in Texas bought a headset for $500 that apparently gives you a view like being in front of a 42 inch TV. Perhaps if you're 100 metres away from it, but he's still happy with it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a client/server app that I'm working on that needs to tell the server to create an archive of a database, then transfer that archive file to any specified machine (even outside the local LAN). How do I give my server the permissions of the logged in user on the client side so it can use that users permissions to move/copy the file in C#?
I've read a lot about "Zones" and FileIOPermissions, but everything seems to be dealing with running things locally.
Thanks!
JT McDuffie
-jtmcduffie@gmail.com
http://www.mcduffie.net/james
|
|
|
|
|
Impersonate the logged in user. You should find plenty of articles here telling you how to impersonate the windows user. That will allow the program to operate with that users credentials.
Logifusion[^]
|
|
|
|
|
Okay, i have found a ton of articles and source code that i have used to try and fix this, but i have had 0 luck so far.
First off, i am trying to get the screensaverr to display a preview. All samples i have seen so far have failed, for me anyway. most seem to involve an IntPtr, but none explains how to use it. i have copied code that absolutely works for the source code, but when i copy mine into it, nada.
the other is getting the screensaver to show on multiple monitors. i routinely work with 2 at a time, and would like to get this working. The issue i seem to have is everyone does a for() loop that counts the number of screens, then launches a screensaver in each one, whihc is all fine and dandy, except for 2 issues. Sometimes, the saver starts and runs in the primary screen, then if you move the mouse, it loads in the same window again. The next issues is that when that doesnt happen, the saver runs on the primary screen, then if you move the mouse, it starts in the second screen. obvious, having it run on both at once is the odeal solution.
Does anyone have any barebones, completely unfancy code that can accomplish any of these?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
|
I have actually looked at that and tried using it for my own, but between the complexity of your code, overlapping with the complexity of mine, i am getting lost.
Yours is actually the ONLY source code i have found that actually does the multiple monitors properly.
I dont suppose you have a sample of just the monitor code hanging around?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
I'm sorry, I don't have anything else, but it's really not complex. You work out the co-ordinates of the total desktop using the code that's in the article, and you draw to those co-ordinates. Once you copy the routine to get those co-ords, the rest is exactly as it is for single monitor, is my recollection.
The rest of it is probably over complex, I scanned the article and note I was apologising for bits of it ...
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hi;
I have this big problem in .net 2005 (C#). In the previouse version (2003) when we made a stored procedure we could simply drag and drop it into the screen and VIOLA you had all the code you needed for the procedure and with a little touch everything was fine. Now in .net 2005 I can't do that anymore or at least I dont know anyway. Could some one help me on this please or at least present another solution or 3rd party tool I could use.
I realy need to use SP.
Thanks very much
Hadi
|
|
|
|
|
If the drag-n-drop is broken or missing, try writing the code yourself.
:josh:
My WPF Blog[^]
|
|
|
|
|
How do you Pass Data from a MDI Child form to its Parent form?
|
|
|
|
|
One common way is to create events in the child form and have the parent form register a listener
Another method is to have a singleton class somewhere that handles the data
You can always pass data through the message loop
Some people choose to write to files (Heck with XP you can even register a folder listener so you can only check the FS when there is an update)
You could write to a database and continuously poll it
You could make all of your members public
this.Parent will give you the parent of an MDI child form BTW
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
i have image in the net
with path http://www.abc.com/aaa.jpg
how can download this image and store it in folder with my application
Palestine
|
|
|
|
|
Replace the url with your url and there you have it
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://www.noviway.com");
// We use POST ( we can also use GET )
myRequest.Method = "GET";
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse myHttpWebResponse= (HttpWebResponse)myRequest.GetResponse();
// Display the contents of the page to the console.
Stream streamResponse = myHttpWebResponse.GetResponseStream();
MemoryStream memStream = new MemoryStream();
byte[] readBuffer = new byte[256];
// Read from buffer
int count = streamResponse.Read( readBuffer, 0, 256 );
while (count > 0)
{
memStream.Write(readBuffer, 0, count);
// Read from buffer
count = streamResponse.Read( readBuffer, 0, 256);
}
byte[] originalBuffer = memStream.ToArray();
// Release the response object resources.
streamResponse.Close();
// Close response
myHttpWebResponse.Close();
Eran Aharonovich (eran.aharonovich@gmail.com )
Noviway
|
|
|
|
|
and how can i save images in file abc.jpg
Palestine
|
|
|
|
|
Just change the URL:
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://www.yoursite.com/abc.jpg");
Eran Aharonovich (eran.aharonovich@gmail.com )
Noviway
|
|
|
|
|
I'm trying to figure out the best way to write unit tests for a singleton class. Naturally, it has a private constructor and is accessed through a static method that returns the only ever instance. However, for unit testing purposes I want to be able to set some state up in advance, put in some mock objects and so on to test that in certain situations the correct exceptions are thrown or results given - all things that I can't really set up through the public interface of the class.
So, for the purposes of unit testing it would be useful to have more than one instance of the class available. Or perhaps there is another solution.
Does anyone have any ideas on how the singleton class might be effectively unit tested?
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|
|
I would create a new instance through reflection since that can still call the private constructor.
Logifusion[^]
|
|
|
|
|
I think unit testing should be done through "normal" code and techniques, which means:
1) Don't add extra code to the original source and remove it after the test, because this way you aren't testing the orginal code.
2) Avoid using special weapons, such as reflection, platform invoke or special debug support. These just make your testing more complicated but less convincing.
If the private constructor is not supposed to be accessed, don't call it directly. No difference from any other private methods. You still can cover the constructor through your first call to Instance() method.
Best,
Jun
|
|
|
|
|
|
Jun Du wrote: Avoid using special weapons, such as reflection
I couldn't unit test without reflection. How do you otherwise test non-public methods, which, in my case, is almost everything; I always opt for internal rather than public, since public can be called by other assemblies. And if your code can be called by other assemblies, a whole new set of rules apply: try running your assembly under FXCop and have a look for yourself.
Reflection is a great tool for unit testing.
One thing I've found very helpful, which also has alleviated my reliance on reflection, is the InternalsVisibleToAttribute. Put this on your assembly to expose all internal members to your unit tester assembly. From there, you no longer need to use reflection to access internal members.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Judah Himango wrote: I couldn't unit test without reflection. How do you otherwise test non-public methods,
Non-public methods are not exposed to outsiders. How do you use them in your applications? Use them internally.
We should do the same thing in unit testing. Write some test cases, each of which is designed to test certain non-public methods, but through public interfaces or methods.
BTW, we usually don't test the compiler-generated code (designer code).
Best,
Jun
|
|
|
|