|
Maybe you can use the class WindowsPrincipal of the namesspace System.Security.Principal.
Where are you from? What is your native lenguage?
|
|
|
|
|
I'm from Argentina
Il try with WindowsPrincipal, THANKZ!!
|
|
|
|
|
hi.
how can I use a button that I created in a graphical program (such as photoshop) as a traditional button in my form?
Best wishes
|
|
|
|
|
Just save the picture as an image file, then in your form, set the .Image property of a System.Windows.Forms.Button to your image.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
Hi,
I have a Web Based C# program that is calling a legacy .DLL file made up of approximately 250 routines to perform credit card authorizations. I'm receiving a System.NullReferenceException somewhere within in the .DLL.
Once the Web C# program calls the initial .DLL module, I lose control of the debugger until it returns. The exception handler in the Web C# program is sighting the initial module as the one that had the NullReferenceException, however I know this is not true.
How can I obtain the real routine that is having a problem? What would be even better is an approximate line number within the routine. I have the source code to the DLL and can add something in there. I just don't want to add printf routines all over it saying, I'm here, I'm leaving.
Thank you,
Glenn
|
|
|
|
|
When you run your app, just attach the Visual Studio debugger to the native process via Tools->Attach to Process...
Also, since you have the source, why not just create a Visual Studio solution with your legacy source as one project in the solution, and your Web C# program as another project in your source? I imagine Visual Studio can take care of the details from there.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
Hi Judah,
I tried to do what you suggested, Tools->Attach to Process... Selected Internet Explorer, clicked Attach and then clicked the check box for Native. Pressed F11 to step into the call and it didn't stop at the error in the DLL.
I thought of creating another Visual Studio project for the DLL, however when I tried to compile it, it took me several hours to remove the error messages from just one of the 250 routines. The .DLL is built with Watcom's 10.6 compiler and is a standard windows DLL.
The C# routine for the web has a try and catch block. Maybe I can add one of those to the C DLL entry point and print out the information. I'll have to go digging in the garage for the Watcom Manauls.
Your thoughts?
Glenn
|
|
|
|
|
i attached a program that view image and make some processing on this image but when the mouse get from the boundaries of the picturebox the code failed although when the mouse moves toward right or left or up dut to picture the coe still work , it faill only when the mouse move toward the bottom of the picture
plz i need a solution to this problem
thanks in advance
haitham
|
|
|
|
|
There is no way for us to help you unless you give us some code. Did you try debugging the application using a debugger such as Visual Studio? This will tell you were the exception is occurring and why its occurring.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
Sorry I forget to accompany the code with message
Here you are the code
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
try<br />
{<br />
textBox1.Text = e.X.ToString();<br />
textBox2.Text = e.Y.ToString();<br />
Bitmap myBitmap = new Bitmap("Calvin2.jpg");<br />
Color pixelcolor = myBitmap.GetPixel(e.X, e.Y);<br />
textBox3.Text = pixelcolor.ToString();<br />
textBox4.Text = myBitmap.PixelFormat.ToString();<br />
label5.Text = "Red depth is " + pixelcolor.R.ToString();<br />
label6.Text = "Green depth is " + pixelcolor.G.ToString();<br />
label7.Text = "Blue depth is " + pixelcolor.B.ToString();<br />
}<br />
catch (System.ArgumentOutOfRangeException)<br />
{<br />
}<br />
}
and i use visual studio.net 2003
haitham
|
|
|
|
|
Well, is the picturebox the same size as the calvin image? If not, then a call to GetPixel(e.X, e.Y) may fail.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
Hi,
I'm trying to download several files at the same time in order to increase
performance.
I've tried to define a method that downloads a file, delegate this method and
call BeginInvoke in a loop.
The problem is that every BeginInvoke returns an IAsyncResult and I don't know
how to figure out when all the calls for this methods where completed.
My Code:
public class AsyncDemo
{
// The method to be executed asynchronously.
public bool TestMethod(string fileAdd, string fileName, out int threadId)
{
threadId = AppDomain.GetCurrentThreadId();
try
{
WebClient Client = new WebClient ();
Client.DownloadFile(fileAdd, fileName);
}
catch(Exception ex)
{
return false;
}
return true;
}
}
public delegate bool AsyncDelegate(string fileAdd, string fileName, out int threadId);
static void Main(string[] args)
{
//files to download
string[] fileUrlArr = new string[2];
string[] fileNameArr = new string[2];
fileUrlArr[0] = "http://www.site1.com/xxx.xml";
fileNameArr[0] = "file1.xml";
fileUrlArr[1] = "http://www.site2.com/xxx.xml";
fileNameArr[1] = "file2.xml";
int threadId;
// Create an instance of the test class.
AsyncDemo ad = new AsyncDemo();
// Create the delegate.
AsyncDelegate dlgt = new AsyncDelegate(ad.TestMethod);
IAsyncResult ar=null;
for(int i=0; i<2; i++)
{
// Initiate the asychronous call.
ar = dlgt.BeginInvoke(fileUrlArr[i], fileNameArr[i],out threadId, null, null);
}
ar.AsyncWaitHandle.WaitOne();
}
Any help will be appreciated.
Best Regards,
Assaf
|
|
|
|
|
First, there are many articles on the web about using WebRequests asynchrounously. I suggest you read a few, such as this one[^].
After you've downloaded the file asynchronously, just store it in some class variable (or, if you have multiple files, store the files by adding them to some list such as System.Collections.Generic.Queue or System.Collections.Generic.List.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
10x, this was very helpful.
|
|
|
|
|
Hi,
I finally got a search in a datatable working (so that I can type "p", and the first row with data beginning with a p is highlighted). I use this:
string searchThis = "p";<br />
DataRow[] dr = tCat.Select("Customer LIKE'" + searchThis + "*'");
My problem is that I need to specify which column to search in. The way it is now, if something starts with a p in the first column, it will highlight the row. (I need to search one of four columns.) Is there any way to determine which column the matched string was found in?
Thanks again so much!
Mel
|
|
|
|
|
By a asp.net page I want to open a file .xml located on my server with excel.
Can i do it?
|
|
|
|
|
if you open a file that is on the server in excel...excel will open on the server. If you want the USER to open a file with excel, you will have to get him/her to download it first.
This question would be better suited to the ASP.NET forum
-- modified at 11:55 Wednesday 7th December, 2005
|
|
|
|
|
|
Hi All,
I have developed a set of User Controls for an application that we would now
like to backfill into a VB6 application. I believe that it is possible to
create an ActiveX control out of the User Control and embed it in a
WebBrowser, but I haven't found any good examples of this. Could anybody
point me to one?
Alternatively, if anybody has any better solutions, I'd be very happy to
hear them.
Thanks,
Paul
|
|
|
|
|
|
Hi friends:
I wrote a componenet in C#(derived from System.ComponentModel.Component)
now, i want use this component in a COM+ Application with pooling objects
but i have samples of componentServiced, and all classes derived from System.EnterpriseServices.ServicedComponent
can you tellme why the serviced component does not inherit of System.ComponentModel.Component or System.ComponentModel.IComponent ????
thanks in advance
|
|
|
|
|
hi.
I want to make pretty forms (with curved edges and with nice shapes) in VS.NET 2005 (C#).
how can I do it?
Best wishes
|
|
|
|
|
|
I have a custom title bar that I simply made from a label. My form is fixeddialog so I can get that raised effect. Everything looks great until I minimize my form to the taskbar. When I do this, I only see the corresponding icon and not the text. This is because my borderstyle isn't "none." And to have a fixeddialog form without a titlebar, you must make the text "". Therefore, I came up with this: When I minimize my form, I change the borderstyle and text so that it appears in the taskbar. The trick now is to get it to restore without the Titlebar. Essentially, I just need to do the opposite of what I did when I minimized the form.
So, my question, do I have access to the "restore" event handler that is called when you either click or right-click on the item in the taskbar? If not, does anyone have another solution to this problem? Thanks in advance.
|
|
|
|
|
Hi I have one xml file,which contains some elements,so i want to load into C# application..i used to NUnit test cases for loading file or not ,,
cheers
Sridevi
|
|
|
|