|
Hi, how can i use this object? never needed so far, but i want to see if helps me somehow
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
I have created a program to enter sites and preview them in the WebBrowser control. The problem is that sometimes when I login to a site, for example it says:
"Welcome Trapper"
and afterwards if I intend to login to the site with a different user, it would not allow this, by still saying "Welcome Trapper". The website has no logout feature, and is probably intended to preserve the user after being logged in.
If you close the program and open it up again, the site would require a username and password (which is what I need) but it is not efficient to have to close and open your program every time a login is to be made.
I have already implemented the code below:
HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
HttpWebRequest.DefaultCachePolicy = policy;
but I need to find something which will totally remove any tracks of the user so the site will ask for my login creditentials every single time... Any help?
|
|
|
|
|
If the site uses cookies, that might be causing the auto login.
Depending on how many sites your app works with, you could try simply deleting the cookie each time before you load up the site.
|
|
|
|
|
Hi,
I have the same problem....
Have you solved your problem? How?
Please let me know..
|
|
|
|
|
Hi,
I'm trying to validate an Xml document using an XmlReader. Here is my code:
private void Validate(TextReader source, string xsd)
{
XmlReaderSettings settings = new XmlReaderSettings();
XmlUrlResolver resolver = new XmlUrlResolver();
settings.ProhibitDtd = false;
resolver.Credentials = CredentialCache.DefaultCredentials;
settings.XmlResolver = resolver;
settings.ValidationFlags = XmlSchemaValidationFlags.ProcessSchemaLocation;
settings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings;
settings.Schemas.XmlResolver = resolver;
settings.Schemas.Add(null, xsd);
settings.Schemas.Compile();
//settings.Schemas.Add(null, http://www.w3.org/2001/xml.xsd);
settings.ValidationType = ValidationType.Schema;
settings.ValidationEventHandler += ValidationHandler;
XmlReader reader = XmlReader.Create(source, settings);
while (reader.Read())
{
}
}
The xsd of the xml document I want to validate contains an xs:import that points to local xsd (the schemaLocation is, as example "./dc.xsd"). This xsd imports serveral other xsd, one of which is the following:
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/03/xml.xsd">
</xs:import>
When settings.Schemas.Add(null,xsd) is executed, all nested LOCAL xsd are correctly resolved by the XmlUrlResolver I created. If i inspect during debug my XmlReaderSetting instance i can see tha all the required xsd are correctly loaded, EXCEPT http://www.w3.org/2001/03/xml.xsd. Then settings.Schemas.Compile() is executed, an exception is raised telling me that the attribute xml:lang is not defined (it's defined in the missing xsd).
This exception is not raised, and validaion is performed correctly, if i manually add the namespace (see the commented line of my code), or if i change the scema location in the xsd file to point to a local copy of xml.xsd (schemaLocation="./xml.xsd").
I would like to know how can I make this work, because i don't want to add manually anything related to this specific scenario (i.e. i would like to reuse the code). In other words, why this remote location is not resolved?
|
|
|
|
|
Hi all,
In one of our project(Windows Servcice) we are facing an issue like
After opening an Oracle Connection ,networks get disconnected before executing the finally block
So not able to close the Oracle Session and the connection is in inactive state for long time
untill we are killing it manually.
Like this we have an inactive sessions of around 165.
This makes the remaining applications getting down.
So please any one kindly guide me to resolve this issue
Thanks in advance
try
{
OracleConnection con = new OracleConnection();
con.ConnectionString = "User Id=scb;Password=scb;Data Source=137;"
con.Open();
}
catch(Exception e)
{
}
finally
{
con.Close();
OracleConnection.ClearPool(con);
con.Dispose();
}
|
|
|
|
|
try
{
using(OracleConnection con = new OracleConnection())
{
con.ConnectionString = "User Id=scb;Password=scb;Data Source=137;"
con.Open();
.
..
conn.close();
}
}
catch(Exception e)
{
}
finally
{
con.Close();
OracleConnection.ClearPool(con);
con.Dispose();
}
|
|
|
|
|
Does anyone know how to actually 'start' a windows service as part of the install (.msi)?
I have a windows service and created an installer for it and it installs fine, but it would be really great if the installer could just start the service after installation complete.
Thanks.
R.Bischoff
Tengas un buen dia
|
|
|
|
|
I haven't done that in quite a long time. IIRC, you had to override the Commit method in your installer class and use the ServiceController class to start the service.
Sorry, I don't have an example. It's been about 5 years since I had to do that.
|
|
|
|
|
That's close to what I thought I had to do, but wasn't sure. I thought I had to do that via 'Custom Action', but I'll try to just add it in the installer first.
Thanks.
R.Bischoff
Tengas un buen dia
|
|
|
|
|
Sure, require a reboot. 
|
|
|
|
|
Obviously, right
Well, sometimes people don't want a server being rebooted, so thats not an option.
R.Bischoff
Tengas un buen dia
|
|
|
|
|
I found an article about capturing the output from a console application
http://www.codeproject.com/KB/cs/ProcessStartDemo.aspx
How do I do the same with a windows application?
I need to capture some text from a certain window in an application. Actually it is the text highlighted that I want.
How do I do that?
|
|
|
|
|
Axell wrote: How do I do the same with a windows application?
You can't do it the same way at all. The technologies and techniques are so different that the article you read is completely useless to you.
Well, VERY SIMPLISTICALLY, you have to get the window handle of the target window you want and then send that window a WM_GETTEXT message, then get the string pointed to by the returned pointer. But! There's nothing that say that every textbox or control has to respond to the WM_GETTEXT message, so there's no way to guarantee this is going to work at all for every control!
WARNING! This technique requires an in-depth knowledge of how Window's windowing system works. If you don't know this, you're going to have an extremely difficult time pulling this off.
|
|
|
|
|
Screen capture and OCR? 
|
|
|
|
|
5 for that.
Simon
|
|
|
|
|
I have the following VB.net codes:
<br />
da = New OleDbDataAdapter(strSQL, dbConn)<br />
dt = New DataTable<br />
da.Fill(dt)<br />
<br />
Dim rows As DataRow<br />
cnt = dt.Rows.Count()<br />
<br />
If cnt > 0 Then<br />
For Each rows In dt.Rows<br />
Total += rows.Item("Total")<br />
Next<br />
End If<br />
I changed to these C#:
<br />
da = new OleDbDataAdapter(strSQL, CGlobal.dbConn);<br />
dt = new DataTable();<br />
da.Fill(dt);<br />
<br />
cnt = dt.Rows.Count;<br />
<br />
DataRow rows = default(DataRow); <br />
<br />
if (cnt > 0)<br />
{<br />
foreach (rows in dt.Rows) <br />
Total += rows.Item("Total"); <br />
}<br />
And I have the error in in above, can anyone help to correct my C#?
Thank 
|
|
|
|
|
When you use a foreach, you need to say what the type is; hence foreach (DataRow rows in dt.Rows) .
|
|
|
|
|
I did try before & had 2 errors:
<br />
cnt = dt.Rows.Count;<br />
DataRow rows = default(DataRow); <br />
<br />
foreach (DataRow rows in dt.Rows)<br />
Total += rows.Item("Total"); <br />
By any chance you know how to fix them? What I need to get values from column 'Total' of those selected row
Thanks 
|
|
|
|
|
rows is already defined in the line above the foreach.
Why not use row seing as it will represent just one row.
foreach (DataRow row in dt.Rows)
Total += row.Item("Total");
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I did try & have small error from Item, but I think I can fix it by using array for the column.
Thanks,
|
|
|
|
|
Item is an indexed property, so you use
Total += rows.Item["Total"]; C# uses square brackets [ and ] for indexers.
|
|
|
|
|
ATC wrote: have the error in in above
Be more descriptive
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
da = new OleDbDataAdapter(strSQL, dbConn);
dt = new DataTable();
da.Fill(dt);
DataRow rows = null;
cnt = dt.Rows.Count();
if (cnt > 0)
{
foreach (DataRow rowsWithinLoop in dt.Rows)
{
rows = rowsWithinLoop;
Total += rowsWithinLoop["Total"];
}
}
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Hello all,
In the solution i am working there are more than 1000 forms and we are planning to enhance all forms' Layouts to support localization, like resizing labels and moving associated controls using TableLayout panel control. Doing manually is tedious and time consuming process.
Any thoughts of how to enhance UI layout to use TableLayout programmatically? (I guess Programmatically little difficult to decide how may rows or columns to create? which controls to be spanned?
Any ideas?)
Thanks
|
|
|
|