|
I do that in this article. All you need to look at is the form event handler code.
http://www.codeproject.com/dotnet/ABTransClockArticle.asp[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I have a reg. expression to search for strings between the "<" and ">" tags. but how do I change the color of all the matches to blue?
|
|
|
|
|
There are few different ways you can do this (as always), you could use the Regex.Split, go through and call Replace on all the matched values with your corresponding value (blue for you) and then use String.Join to put it all back together.
|
|
|
|
|
Yes, but most web pages use cascading style sheets to specify colour. You must grep for '
|
|
|
|
|
Richard Schneider wrote:
Yes, but most web pages use cascading style sheets to specify colour.
The problem is that, 'most', is not inclusive, nor was my response. I was only offering a suggestion on how he might attempt it - there are many possible solutions. Thanks for pointing out that the colors could also be defined within a css file, just as well they could be inlined with the HTML in a <style> tag.
|
|
|
|
|
hai everybody,
i used the following code to cast an item from the hashtable. but i always get an exception that is an invalid casting.
<br />
foreach (Object objActiveObject in _breathObjectHash)<br />
{<br />
ActiveObjectsInLevel tmpObject = (ActiveObjectsInLevel) objActiveObject;<br />
ActiveObjectsInLevel myXml = new ActiveObjectsInLevel(tmpObject.Row,tmpObject.Column,tmpObject.ExistingObjects);<br />
myObject.SetValue(myXml,count);<br />
count++;<br />
}
please help me
Regards,
Rathish P S
|
|
|
|
|
Have you tried this?
<br />
foreach (Object objActiveObject in _breathObjectHash)<br />
{<br />
if( objActiveObject is ActiveObjectsInLevel )<br />
{<br />
ActiveObjectsInLevel tmpObject = (ActiveObjectsInLevel) objActiveObject;<br />
ActiveObjectsInLevel myXml = new ActiveObjectsInLevel(tmpObject.Row,tmpObject.Column,tmpObject.ExistingObjects);<br />
myObject.SetValue(myXml,count);<br />
count++;<br />
}<br />
else<br />
{<br />
Console.WriteLine( "Wrong Type: " + objActiveObject.GetType().ToString() );<br />
}<br />
}<br />
_________________________________
Vote '1' if you're too lazy for a discussion
|
|
|
|
|
hai Corinna John,
thanks for your comment.i tried the above.but always that else part only works so i triedthe following code and succeed.
foreach (Object objActiveObject in _breathObjectHash)
{
int index = objActiveObject.GetHashCode();
ActiveObjectsInLevel tmpObject = (ActiveObjectsInLevel) _breathObjectHash[index];
ActiveObjectsInLevel myXml = new ActiveObjectsInLevel(tmpObject.ObjectKey, tmpObject.Row,tmpObject.Column,tmpObject.ExistingObjects);
myObject.SetValue(myXml,count);
count++;
}
Regards,
Rathish P S
|
|
|
|
|
Hi
In user32.dll there is a function called LockWorkStation.
Is there an complement to it??
Or is there any comparable in msgina.dll?
thx
|
|
|
|
|
|
Stefan, I think he wasn't searching for an equivalent, but for a complement
I guess there's no reverse function to unlock the workstation.
Platform SDK states:
"This function has the same result as pressing Ctrl+Alt+Del and clicking Lock Workstation. To unlock the workstation, the user must log in."
Besides, what would be the point of LockWorkStation if you could unlock it programmatically?
mav
|
|
|
|
|
|
If, by "complement", you mean is there a function to unlock the workstation, no there isn't. The user has to hit Ctrl-Alt-Del and login again. It can't be remotely unlocked for security reasons.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello folks,
I have never been in a project where I need to use legacy dll (non COM dll)
I looked at some examples from that I found in codeproject but I still have some question.
Suppose I have the following methods in my dll:
RF *rfOpen( const char *dev, int mode );
int rfTest ( RF *reader, char *namestr, int namesize, char *verstr, int versize );
where RF declared like this:
typedef struct rfreaderstruct RF;
struct rfreaderstruct {
HANDLE fh;
OVERLAPPED in_ov;
OVERLAPPED out_ov;
unsigned char buffer[BUFSIZ]; /* Read buffer */
int bufferPoint; /* Number of bytes used from inBuf */
int bufferCount; /* The number of bytes in inBuf */
char nonCommandBuffer[BUFSIZ];
int nonCommandBufferPoint;
int nonCommandBufferEnd;
int mode;
int requestInProgress;
int requestOutProgress;
int pendingWrite;
int pendingRead;
RFMessage rfmsg;
int responseState;
unsigned int responseDataCount;
RF *next;
};
how can I make them readable in .Net?
Thanks
|
|
|
|
|
If you never have to manipulate the members of the RF structure, it's pretty straightforward:
[DllImport("legacy.dll")]
public static extern IntPtr rfOpen( string dev, int mode );
[DllImport("legacy.dll")]
public static extern int rfTest( IntPtr reader, StringBuilder namestr, int namesize, StringBuilder verstr, int versize ); For an 'out' string parameter, you should use a StringBuilder . Set the Capacity appropriately and pass that for the namesize parameter.
If you do have to manipulate RF directly, it will be a lot harder.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
does anybody know an opensource report generator like jasper reports written in C#?
I need the ability to show a print preview, send report to printer and create a pdf-document.
Or is it possible to integrate a java-program into a .net-program?
Thanks
Alexander Roos
|
|
|
|
|
|
You need to implement the IInputObject interface.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks for reply Andy
after revieing source file from the proejct
http://www.codeproject.com/csharp/dotnetbandobjects.asp[^]
i found the following mehtods in Bandojectlib.cs file
public virtual void UIActivateIO(Int32 fActivate, ref MSG Msg)
{
if( fActivate != 0 )
{
Control ctrl = GetNextControl(this,true);//first
if( ModifierKeys == Keys.Shift )
ctrl = GetNextControl(ctrl,false );//last
if( ctrl != null ) ctrl.Select();
this.Focus();
}
}
protected override void OnGotFocus(System.EventArgs e)
{
base.OnGotFocus(e);
BandObjectSite.OnFocusChangeIS(this as IInputObject, 1);
}
protected override void OnLostFocus(System.EventArgs e)
{
base.OnLostFocus(e);
if( ActiveControl == null )
BandObjectSite.OnFocusChangeIS(this as IInputObject, 0);
}
How can i cal these methods so that it can enable BACKSPACE key in the toolbar?
kindly guide me please
Thanks
|
|
|
|
|
Check out this article from Microsoft. It's C++, but you should be able to convert it over.
http://msdn.microsoft.com/msdnmag/issues/01/08/c/[^]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks for your reply
i visited the site and did find clue like
it was handled like that in C++ like that:
if (msg==WM_KEYDOWN) {
// on keydown, pass to edit as WM_CHAR
::SendMessage(hwndEdit, WM_CHAR, key, pMsg->lParam);
}
in Delphi i found the following:
function TDelphiBand.TranslateAcceleratorIO(var lpMsg: TMsg): HResult;
// Passes keyboard accelerators to the object.
begin
if (lpMsg.WParam <> VK_TAB) then begin
TranslateMessage(lpMSg);
DispatchMessage(lpMsg);
Result := S_OK;
end
else Result := S_FALSE;
end;
i coudnt find TranslateMessage and DispatchMessage in C#
neither i found SendMessage Equivalent in C#
|
|
|
|
|
I'm trying to pull a list of links from a webpage. I have everything working, but my problem is that if a url has an "&" in it, my code returns it as "& amp;" Here is a snippet of my code:
<br />
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(Url);<br />
webRequest.Timeout = 10000;<br />
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();<br />
Stream responseStream = webResponse.GetResponseStream();<br />
string responseEncoding = webResponse.ContentEncoding.Trim();<br />
<br />
if (responseEncoding.Length == 0)<br />
{<br />
responseEncoding="us-ascii";<br />
}<br />
StreamReader responseReader = new StreamReader(responseStream, System.Text.Encoding.GetEncoding(responseEncoding));<br />
<br />
string html = responseReader.ReadToEnd();<br />
responseReader.Close();<br />
I know I can manually remove the "amp;" from the link, but I was hoping there was an easier way
-david
|
|
|
|
|
HttpServerUtility has the UrlDecode method that will do the translation.
[edit]
Since it is a Url, you would think that UrlDecode is the right method, but & would be encoded in %xx format, so HtmlDecode might be the correct method.
[/edit]
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks alot for the help andy, thats just what I was looking for.
|
|
|
|
|
Good day everyone!
i had problem in returning a DataReader object from a ServicedComponent class. The dataset object was return fine, but when return the DataReader, the datareader object was a transparent_proxy object. I dont understand why only the return DataReader object is a transparent_proxy?
And if i use any method of the returned DataReader, the following error will be occur:
This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server.
my codes is simplied as follow:
//First layer is DataAccess Layer
public sealed class DataAccess : ServicedComponent
{
//others methods here...
public OleDbDataReader ExecuteReader (OleDbConnection objConn, string
sql, CommandType commandType, OleDbParameters paramList)
{
//SomeOthers codes here...
return objCmd.ExecuteReader(CommandBehavior.CloseConnection);
}
}
//Second Layer is Data Access Logic
public class EmployeeDAL : ServicedComponent
{
public IDataReader GetEmployeesFirstName()
{
//someothers codes here...
DataAccess objDa=new DataAccess();
OleDbConnection objConn=new OleDbConnection();
return objDa.ExecuteReader(objConn,sql);
}
}
Thanks in advance for your help.
gkb
|
|
|
|