|
Hello !
I'm trying to use a web custom control compiled in vb.net in my c# application. But i get a compilation error at run-time. When using the same web custom control in a vb project, i have no problem at all.
Error message
CS0234: The type or namespace name 'Application_Header' does not exist in the class or namespace 'Application_Header.Application_Header' (are you missing an assembly reference?)
note: the namespace i used is referenced in References and also with the using statement.
Does anyone have an idea , because i'm lost and i'd rather not start developping in vb.
Thanks
|
|
|
|
|
|
hi,
is there any embedded database used by desktop applications other than MSDE?
thanks
|
|
|
|
|
Try googling SQL Lite, which comes with an odbc driver, and also a native .net driver for it.
|
|
|
|
|
There is also the Firebird database project.
http://firebird.sourceforge.net/
It has a .Net provider and also an embedded version. And the price is right.
Steve Maier, MCSD MCAD
|
|
|
|
|
|
Hy everyone!
I want to change the icon of my WindowsForms Window and my notifyicon depending on the system state meaning, if the apllication is able to do a special kind of work then the icon is style A, if it fails then it changes to style B. If the user tries again and this time it works then the icon changes back to style A.
In general:
application works correctly => icon A
application fails => icon B
application works correctly (after having failed before) => icon changes from B to A.
Well how do I realize this in my application? I know there is something like notify.Icon but there it says for example
this.tbiNameKeyService.Icon = ((System.Drawing.Icon)(resources.GetObject("tbiNameKeyService.Icon")));
at the moment I have no idea
1) where the application chooses to use my icon I assigned in the properties
2) how to change/switch the icon depending on the state (ok/failure) because of 1)
I mean I could have tried to use an absolute link to the file but then my application is fixed to this configuration. But I want it not to be absolute! Meaning I do want to being able to "port" it to another computer.
Thanks!
Stephan.
|
|
|
|
|
Basically you will want a way to query the status of your application, you could use a timer if needed, however when the status changes to whatever you specify, simply change the icon of your application. You could store the icons in a resource file, are you asking how you extract it?
- Nick Parker My Blog | My Articles
|
|
|
|
|
if you mean the following by "query the status of my application" then you are right:
it should do the following
try
{
//do something
//displayed icon is ok icon
set ok icon
}
catch
{
// catch error
// displayed icon is failed icon
set failed icon
}
above is an example for what I want to do.
Well this means I would have to "switch" the icon (see pseudocode above).
Well change the icon? uhm, that's what I do not know how to do! Could you please post a sample how to do this or post a reference where it is described how to do so.
I do know how to set the icon by
notify1.Icon=new Icon("myicon.ico");
but what do I have to do in the example above?
At the moment I added
notify1.Icon=new Icon("myokicon.ico");
to the try section and
notify1.Icon=new Icon("myfailicon.ico");
to the catch section.
Well the first time it works, but when I do want to do the next switch then it crashes.
Meaning I am only able to do
notify1.Icon=new Icon("myicon.ico";
once and never again.
But what do I have to do to change this as often as I want it to change?
So once again I would ask you to please let me know of a sample how to manage this problem or a link to a reference which describes how to manage this.
Thanks!
Stephan.
|
|
|
|
|
I guess I just did it, well have to do some further testing!
What I did is the following:
first defining my icons
<br />
Icon iok=new Icon("myokicon.ico");<br />
Icon ifail=new Icon("myfailicon.ico");<br />
then I do just assign the icons designed above to the icons I do want to change. (Meaning when I do want the OK then I do assign this one, when I do want the failed then I do assign the failed.
It's quit simple when you know how to do this!
And that's it!
Stephan.
|
|
|
|
|
I decided to change the Icon iok=new Icon("myokicon.ico"); statements because there I hardcoded the icon and if I install my application as an addin the file is no longer found.
So I decided to replace the code above by adding the iconfile as an embeded resource. So I have to access it via the resource. But I am not sure which "namespace" is ment in there.
The definition for this is: namespace.filename.filetype
But well is the namespace the namespace I chose for my whole WindowsForm or is it the object I assigned the ressource to (meaning an element out of the whole WindowsForm).
lets say my icon is named FACE04.ICO what name does it have to be accessed with?
In the main section of my WIndowsForm (Initialize) I saw something like
ressource.GetObject("$this.Icon")
well I guess my "filename" has to be very similar but no matter which I tried it always failed an the standardicon was used.
Does the filename have to be casesensitive?
Maybe one of you could tell me please, what the "filename" has to look like.
I do want to create it as a global meaning I created a global icon for "OK" and one for "fail" but did not assign anything. Well to initialize it I will have to assign the icon, but what does it have to look like? I also tried the solution in the MSDN but again no icon found.
The easiest way would have been to add the line in the Initialize section but you shouldn't put it there because changing the Form means this being rewritten as a whole and loosing every line which wasn't autogenerated. So I have to put it somewhere into the main.
The icons should be assigned to the Window and to the notification object. Well this shouldn't be the problem, because it worked when being hardcoded.
Thanks for any suggestion!
Stephan.
|
|
|
|
|
Hello,
i have a problem verifying certificates using CAPICOM. As you know you can choose some flags in order to spezialise the verification...i do that, but there are 2 flags that although i have the correct certification chain installed tell me that there s a verification error. Here i show you a piece of my code:
<br />
Certificate c;<br />
ICertificateStatus status = c.isValid();<br />
status.CheckFlag = CAPICOM.CAPICOM_CHECK_FLAG.CAPICOM_CHECK_TRUSTED_ROOT;<br />
<br />
status.CheckFlag = CAPICOM.CAPICOM_CHECK_FLAG.CAPICOM_CHECK_ONLINE_REVOCATION_STATUS;<br />
<br />
Those flags tell me that there is a verification error...but i have the verification chain properly installed!!
Thank you for your help and advice.
|
|
|
|
|
I want to retrieve the usernames and passwords of all the users present on the active directory of a server. How will I be able to do that? Any sugestion is welcomed..........
|
|
|
|
|
You can retrieve the usernames but you cannot retrieve passwords, for obvious security reasons and the user-password attribute is write-only.
using System.DirectoryServices;
DirectoryEntry entry = new DirectoryEntry("LDAP://PathToStartOfSearch");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.Filter = ("(&(objectClass=user))");
foreach(SearchResult result in mySearcher.FindAll())
{
Console.WriteLine( result.GetDirectoryEntry().Path );
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Guys,
I created a program that validates all fields after pressing the accept button. My problem is I can't find a solution for a popup message. This popup message is not related in my accept button but to the message that will be displayed on screen during the validation.
I'm using this statement
Response.Write("<script language=javascript>");<br />
Response.Write("alert('Please click me')");<br />
Response.Write("</script>");
but when it popup on screen the background screen disappear.
Do we have like a message box in web the same as the messagebox in WINDOWS application?
I need modal pupop.
Regards
/Dabuskol
pls. id you can redirect or any idea will help.
thanks.
|
|
|
|
|
I guess you might use ValidationSummary control that has property "ShowMessageBox".
But be aware that client-side validation won't work if client uses browser which doesn't support client-side scrips.
"Absolution requires sacrifice" -- Dan Brown 'The Da Vinci code'
|
|
|
|
|
You can look at window.showModalDialog command, but that will only work for IE. If you also need Mozilla support you might have to use window.open and then window.opener.<mind is="" drawing="" a="" blank=""> command. Doing a google search on showmodalDialog and Mozilla and you should find code for that.
There is also the ASPPopup article on doing a popup.
http://codeproject.com/aspnet/asppopup.asp
I have been looking at this for info and adding buttons to it as well. But for just telling the user that its busy it might work.
Steve Maier, MCSD MCAD
|
|
|
|
|
Hi Steve,
Actually I was using this asppopup on my current web page but our user doesn't like this becuase it's not modal, they can still update the current page even though the popup window is visible.
I also tried the indow.showModalDialog command but again the behaviour is the same as the ALERT/PROMPT/CONFIRM from javascripts it's modal but the problem is that the current page display disappear while the modaldialog window appears.
Anyhow, Thank you for your help. Just in case you found any sites kindly inform me, the same with me if I found the solution I'll post here using this thread.
/Dabuskol
|
|
|
|
|
I put up a test page on one of my servers and I am still seeing the curent page. It is NOT disappearing. Here is the link:
Test Page
Of course if the fact is that you want it to disappear then that would explain the issue. I was talking to someone last night about changing the asppopup to be more modal. If we do this I will let you know.
Steve Maier, MCSD MCAD
|
|
|
|
|
Hi Guys,
I'm happy to inform you all that I found the solution. I missed the 3 last lines. Now I can say that it's 100 working. Hope this will help you and the other new web programmer of .net like me.
private void DisplayErrorMessage(string strMesg)<br />
{<br />
string strScript = "<script language=JavaScript>" +<br />
"alert('" + strMesg + "');" +<br />
"</script>" ;<br />
if (!Page.IsStartupScriptRegistered("clientScript"))<br />
{<br />
Page.RegisterStartupScript("clientScript", strScript) ;<br />
}<br />
}
/Dabuskol
|
|
|
|
|
Hi,
I am looking to (hopefully quite simply) populate a drop down list with a
list of the currently open windows (applications) and their respective
HWND's
I have found various snippets using GetWindow and FindWindow from user32.dll
but have been unable to get it all working.
Any help / code examples would be much appreciated. Preferably in C# but any
examples would be useful.
Thanks in advance,
Robin
|
|
|
|
|
Hi, I've done this (for getting a mirc window and sending it a message), but the code is pretty lengthy. Email me web@sloppycode.net if you need it.
|
|
|
|
|
I'd like to create a simple XML browser that displays a XML file an similar way as IE does. I'm not doing anything with the file, just want to display it in a readable way.
I have tried with xmlreader and richtextbox classes but not really been successful in formatting the XML in a nice way.
reader = new XmlTextReader(xmlfile);
reader.WhitespaceHandling = WhitespaceHandling.None;
// Parse the file and display each of the nodes.
int curr = 0;
int next = 0;
while (reader.Read()) {
curr = reader.LineNumber;
richTextBox2.AppendText(reader.Name);
richTextBox2.SelectionColor = Color.Blue;
richTextBox2.AppendText(reader.Value);
richTextBox2.SelectionColor = Color.Black;
if ( curr > next ) next = curr;
else richTextBox2.AppendText("\n");
}
Is this the right way to go, or should I start looking at other solutions?
|
|
|
|
|
If you want something really simple and quick, just embed the web browser into your application and then navigate to the xml file.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Well, I was advised to use the webbrowser COM component and that was it.
|
|
|
|