| Using ServicePointManager |
|
 |
Index ‹ DotNet ‹ Dotnet
|
- Previous
- 1
- Visual C#.Net >> Fade PictureBoxHi everyone I'm new to winforms from asp.net and I'm trying to fade in/out
an image in a picturebox on a winform. I'm doing research and I've found
things like opacity for the winform, but I haven't had any luck with a
picture box.
Can someone please point me in the right direction?
Thanks,
Ben
- 2
- Visual C#.Net >> Layout manager issue when docking panels?I was playing around with a new Windows form yesterday. I wanted to drop two
panels on the form. The first would be set Dock=Top. The second would be set
Dock=Fill.
So, I dropped the first panel and set its Dock property to Top. I then dropped
the second panel on the form and set its Dock property to Fill.
Holy disappearing panels, Batman. The second panel filled the entire form
hiding the first panel. So, when I dropped my grid control on the second panel
which was set to Dock=Fill, it filled the entire screen.
I eventually got what I needed by cutting and pasting the controls, which was a
suggestion of a fellow developer at work, but it was a bit annoying.
Is there a bug in the layout manager in the forms designer that is causing this
behavior?
- 3
- 4
- Dotnet >> How do I build the project sample to detect and install CFHello friends
I have got a sample code from msdn in the following link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfdepl.asp
but i am not understanding how to build this project and how to get the .msi
file to start the setup.
if u know please help.
with regards
Meghna
- 5
- Winforms >> Cancel windows message from reaching parentI am developing a set of controls that must function inside of an application
that loads them through COM interop (I don't believe that makes a
difference). The application is designed to always handled the "Enter" key.
One of my controls is a text box which needs to allow the user multiline
input and not being able to use the "Enter" key is borderline unacceptable.
I have tried to override WndPRoc, PreProcessMessage, and a host of other
behaviors, but I cannot get the application to stop catching the enter
message.
I have written all messages to a text file when I transition using enter
versus using a mouse click, and I cannot even find a message that indicates
my control received an "Enter" at all.
All suggestions welcomed.
- 6
- ADO >> Connection Pool Time OutHi all,
I have the following scenario:
App1: Asp.Net Application that shows reports from some SQL DB
App2: Asp.Net WebService with two services exposed for clients, and a single
â??Checkerâ?? in the Application object that checks every some time (normally 2
or 3 minutes) for conditions in the same DB, and insert some values in it
using a transaction.
When the time spans completes, the checker retrieves via a SqlDataReader the
ready items and make the insertions as shown:
SqlDataReader reader = GetReadies();
try
{
// do something
// initialize the transaction â??transâ?? and the connection â??conâ??
try
{
// insert using the transaction
trans.Commit();
}
catch(Exception ex)
{
trans.Rollback();
throw ex;
}
finally
{
trans.Dispose();
con.Close();
}
}
finally
{
reader.Close();
}
In the web application I have few pages that get information from the DB,
and after a few retrievals, I got this error:
â??Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were in
use and max pool size was reached.â??
So I review all code searching for unclosed datareaders or connections, for
nothing. I use SQLHelper in the web application and I always retrieve
datasets, anyway, I checked that all connections were closed.
Then I review the code in the webservice app, I think it is correct, isnâ??t it?
Even though I didnâ??t found unclosed connections, I started to watch the .Net
CLR Data performance object with the object Current # pooled connections. The
graph never goes over 7 connections; it oscillates between 5 and 8. I also
started a new trace in the SQLProfile to see if it audits logout events
occurs.
And still, after a while browsing in the asp.net application, I receive the
same error.
Note: the max pool size is set to 100 explicitly.
Any idea of the cause?
Thank you very much.
- 7
- 8
- Visual C#.Net >> Anonymous type etc. in C# 3.0I understand, basically, what this C# 3.0 code does, but I am unclear
on how it determines the data type of num and index in the lambda
expression in the following code. Nor can I see how it gets the array
index into the index parameter?
BTW: Is there a better forum for asking these questions?
public void Linq12() {
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var numsInPlace = numbers.Select((num, index) => new {Num = num,
InPlace = (num == index)});
Console.WriteLine("Number: In-place?");
foreach (var n in numsInPlace) {
Console.WriteLine("{0}: {1}", n.Num, n.InPlace);
}
}
- 9
- Visual C#.Net >> Getting local admin groups and users on a windows server using ADSIhi all,
i am trying to get local admin users and groups on a windows server.
here is the C# code that i am using
***************************************************************************************************
DirectoryEntry AD = new DirectoryEntry("WinNT://" + sServerName +
",Computer",UserName,Password);
DirectoryEntry admGroup = AD.Children.Find("Administrators", "Group");
object members = admGroup.Invoke("Members", null);
foreach(object member in (System.Collections.IEnumerable)members)
{
DirectoryEntry user_groups = new DirectoryEntry(member);
// do some work.
}
******************************************************************************************************
I have 2 issues here.
1. Its not getting all the local users and groups from the
Administrators group on the box.
2. How does it know which domain to look for with just "WinNT://" +
servername.... i have 2 domains, test and production and both domains
have same server names. i.e there is a AppServer in each of the test
and production domain.
3. Is there a different syntax to tell the DirectoryEntry object to
look at a particular server on a particular domain?
thanks,
shashank kadge
- 10
- Winforms >> Custom DataGridView Columns and CellsHi,
I have an application with a DataGridView that displays a Questionnaires
questions and allows a user to fill in answers to these questions in the
gridview.
Each question knows its questionType (Date, Text, or Yes/No/Na). I have
created a custom column that inherits from datagridviewcolumn and have
created a custom cell that inherits from DataGridViewTextBoxCell.
In my cell object, I get the OwningRow.DataBoundItem to reference the
QuestionObject and then Get the QuestionType of the question in that row.
After I do this, I use a select case statement to determine the type of
editing control I need for Edit purposes. This way, Date questions get a
datepicker edit control, YES/NO/NA questions get a combobox edit control and
Text questions get a text box edit control.
I have my DataGridView displaying the correct type of editing controls when
edit mode is entered on the cell. And my Text Box and DatePicker Edit
controls seem to be working right as well.
I am having a problem with the ComboBox edit control for my custom cell.
Even though I specify the Items list for the combobox, when the combobox is
displayed, none of the items show up in the dropdown and even if I type an
answer in the combobox, it doesn't enter edit mode.
There are also some other strange behaviors going on in terms of values
displayed when entering edit modes and in display mode.
I would really appreciate any help here I can get. This has been a big
problem for me to solve and have gotten close, but not yet complete.
Thanks so much in advance for your help.
Guy
- 11
- ADO >> File format for a new application(I know it's a seond post, but I think I explain it better this way)
--
On my own I'm writting an application for the general public.
(a bit like word, except it has nothing to do with word ;-)
So far I used an embeded database engine to store the data (SQLite), I like
the concept because this way I could load/delete/updata whatever data I need
incrementally on demand. And I could also easily perform search.
What gets me more and more concerned is that creating a new (empty) file
(with just about 10 table, 30 index & triggers) takes up to 7 seconds!
Very bad user experience.
I'm considering my options and will gladly takes advice as I'm a bit daunted
by the work involve just to test.
- I was thinking to try an other embeded database engine, such as Firefox.
- I was thinking to use tar-gzipped serialized file (think XML serialization
should be better as it would be probably be better at version resistance
(but worst perf?)), but I was wondering about the wisdom of having all my
data in memory...
- any other ideas?
- 12
- Visual C#.Net >> Order of Columns in the Datagrid binding.Hi, Dear gurus,
I want to bind my collection to a datagrid. The field names in my object
show up in a weird order, and I just wonder how I could reorder those
columns .
I find some code like the following , but I don't want to do it that way
because it won't work if I have large number of fields.
[
DataGridTableStyle myGridStyle = new DataGridTableStyle();
myGridStyle.MappingName = "GridTableMappingName";
DataGridTextBoxColumn nameColumnStyle = new DataGridTextBoxColumn();
nameColumnStyle.MappingName = "GridColumnMappingName";
nameColumnStyle.HeaderText= "GridColumnMappingName";
myGridStyle.GridColumnStyles.Add(nameColumnStyle);
myDataGrid.TableStyles.Add(myGridStyle);
]
I believe there must be some better way to do that(using reflection) .
Anybody gives me some hint on that. A link to a example is highly
appreciated.
Thanks,
J.W.
- 13
- Visual C#.Net >> Question: Load bmp and save as jpgI want to convert one bitmap file to another one.
For example load as bmp and save as jpg.
The loading part is simple I do this:
Stream BitmapStream =
File.Open(sSrcFile,FileMode.Open,FileAccess.Read,FileShare.None);
Bitmap imgPhoto=new Bitmap(BitmapStream);
iPixelsX=imgPhoto.Width;
iPixelsY=imgPhoto.Height;
BitmapStream.Close();
The saving will be something like this; but I fail to see how I can hook up
imgPhoto from the load to this stream.:
Stream DestBitmapStream =
File.Open(DstFile,FileMode.CreateNew,FileAccess.Write,FileShare.None);
// how do I connect imgPhoto?
DestBitmapStream.Close();
Also I wonder if the Pixelfomat is different, lest say I load 8 bit indexed
color palette bitmap and want to save as 24 bit RGB jpeg, could this be done
automatic?
Something tells me that I need to copy the bytes manually??? I hope not.
Many thanks.
Olaf
- 14
- Winforms >> Unable to hide form? in .NET 2.0Any suggestions on how to make a form not visible when displayed via
Form1.ShowDialog() ?
If I put a button on the form called "Close" and in the click event I put
Me.visible = false, the form closes and my application terminates. I don't
want this, I just want it to hide (Me.Hide is the same as Me.visible).
I'm using a module1.vb with a sub Main() from the sub Main I Dim Form1 as
New myForm and then call the Form1.ShowDialog.
I can't find any way to hide a Form that is initially displayed (Modal) via
ShowDialog which closing the form. Is this just not possible in .NET 2.0
Rob.
- 15
- Microsoft Project >> Resource Assigment Dates Not Matching Task Level DatesResource Assignment Dates not the same as task level dates.
For Example:
Task: Build Radio - 40 days dur. 1/30/06 to 3/24/06
Resources: John 100hrs & Bill 60hrs.
I want both John and Bill's hours spread evenly across the duration, however
my schedule now in the task usage view shows only John (resource with most
hrs) spread across the duration and Bill's hours are at a much shorter date.
I want them both spread evenly across the entire duration. All of my tasks
are fixed work and they need to stay that way. I can manually go into task
usage and fixed the dates, however once status is taken Project reverts back
to the above.
Is their a setting in project I am missing?
Is it because of fixed work?
Please help!!!!
Thanks,
KG
|
| Author |
Message |
gln

|
Posted: Fri Sep 07 01:54:18 PDT 2007 |
Top |
Dotnet >> Using ServicePointManager
Is the object global? I would like to ignore ftp server certificate validity
making connection to it in one part of my application. Will it apply the
validation bypass to this thread, process or whole .net platform?
DotNet247
|
| |
|
| |
 |
Vadym

|
Posted: Fri Sep 07 01:54:18 PDT 2007 |
Top |
Dotnet >> Using ServicePointManager
Hello, valentin!
ServicePointManager has only static members.
So, it is global for AppDomain. If you have 1 AppDomain (the default one)
then it is global for the whole
.NET application.
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com
You wrote on Thu, 6 Sep 2007 18:04:10 +0300:
vt> Is the object global? I would like to ignore ftp server certificate
vt> validity making connection to it in one part of my application.
vt> Will it apply the validation bypass to this thread, process or
vt> whole .net platform?
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Dotnet |
- Next
- 1
- 2
- Net Framework >> Delegates and InterfacesI have a dilemma that I'm having a tough time getting through on a VB
2005 issue. I have a custom control for a form to display data from a
windows form. Right now, the main form calls various web service
methods in order to update the data. Since the data to be displayed
depends on the call to the web service, I use a delegate that will
invoke the method when a timer elapses. Works good for now but I want
to create additional custom controls that will display data and have
the main form cycle through the controls. Because of this, I figured
that it would be easier to implement an interface on the custom
control so that the form can instantiate the controls dynamically as
it cycles through.
So here's my dilemma. The control (or controls) could call various
methods to get a "data refresh". Therefore, I wanted to give the
control the delegate to invoke within itself as the main form cycles
through each control on a separate timer. But how do I do that using
an interface? I can't have the delegate on the interface because its
a type. I can't pass in the signature to the c'tor because it's not a
type. What options do I have?
I appreciate any help anyone can give.
- 3
- Visual C#.Net >> Parameterized Query unexplainably slowHi,
I came across a very weird problem. I get a statement from a file, dump
the text into a sql command, add a sql parameter and run the query.
This lasts about 1 1/2 hours, compared to 2-3 minutes running the same
statement from within the sql query analyzer.
To get around this problem I added the following lines INTO the
statement file:
declare @param int
set @param = 20060411
using this, the statement lasts 2-3 minutes.
When using s sql parameter with the sql command the same statement
needs 1 1/2 hours. I added the parameter as follows:
cmd.Parameters.Add("@FromDate_SID", date.ToString(("yyyyMMdd")));
or
cmd.Parameters.Add("@FromDate_SID",
Convert.ToInt(date.ToString(("yyyyMMdd"))));
Both result in a duration of 1 1/2 hours.
Does anyone can give me a clue on this? I'm lost, and I am running out
of ideas.
Thanks in advance
Michael
- 4
- ADO >> Sql Statement ErrorsHi Group,
Hope somebody could help? I have a table called ArcirisUsers which has a
field called SITES. I would like this field to pull a list of sites from the
Site feild in my SITES table. I have created the following SQL stement:
SELECT ArcirisUsers.Usersname, ArcirisUsers.POSID,
ArcirisUsers.POSAccess, ArcirisUsers.[Password], ArcirisUsers.LiveDate,
ArcirisUsers.BomID,
ArcirisUsers.BomAcc, ArcirisUsers.ArcirisUsersID,
Sites.[Site Name]
FROM ArcirisUsers INNER JOIN
Sites ON ArcirisUsers.PrimarySiteID = Sites.SitesID
However when I try and run this it comes back with a error saying "No Value
Given For One Or More Parameters"
When I try and create the above in my DataAdapter Wizard it comes back
telling me "Cannot Get DataScheme" Which I assume is because the SQL query
is
wrong?
Could anybody please Point me in the right Direction?
Regards
Si
- 5
- Net Framework >> Is there any predefined delegate with no argument?Hi,
I am looking for a predefined delegate which in form:
delegate void NoArgument();
It's quite useful than other delegate with argument, I found
MethodInvoker in WinForms, which defined in such form, but I don't
want to add WinForm reference all the time, since my code nothing
relative the WinForm.
The reason why I use no argument delegate is quite often is that it's
quite easy to access local variable if I use anonymous methods, which
may decrease the prerequest of declare a delegate with some argument
to pass in.
For example, when I try to access WinForm in thread safe way, I
defined a static function DoThreadSafe():
private static void DoThreadSafe(Control control,
MethodInvoker function)
{
if (function != null)
{
if (control.InvokeRequired)
{
control.Invoke(function);
}
else
{
function();
}
}
}
When I use it, I do not need any parameter to pass to the "function",
such as:
value = 123;
DoThreadSafe(progressBar1, delegate
{
progressBar1.Value = value;
});
It is really easy to access the variable which is accessible in
current scope. I found many such cases which treat the delegate just a
block of code to execute without any need of argument.
I think that it's better to treat void delegate with no argument as a
special, and predefined in dotnet framework, and may be more
convinient to declare and call in the future version of C#. Is there
any existing delegate in .net framework?
Regards,
- 6
- Microsoft Project >> Resource displayWould it be possible to display resources in different columns, depending on
the resource group?
Could I generate a report showing the different columns and tasks?
- 7
- Dotnet >> Can not change application iconA VC.net application, the 3 16777216-color icons, 16*16,
32*32 and 48*48, have been modified, but after rebuild the
application, the icon does not change. Should we modify
anything else to change the icon?
- 8
- 9
- 10
- Net Framework >> Memory leakage!!Please look at the following URL:
http://forums.devbox.net/showthread.php?p=3082#post3082
Can anyone suggest me the solution to this?
Thanks a lot!!
- 11
- 12
- 13
- Microsoft Project >> Changing resource calendar with a 24 hour project calendarWe have a project that is set up with a 24 hour calendar and resources that
are allocated either to a 24 hour or a 12 hour calendar. If we change a
task with a 24 hour resource calendar to a 12 hour resource calendar, the
task still showed as the resource working through the night as if they were
on the 24 hr calendar.
The task is a fixed unit task.
By doing this, our critical path also changes - any ideas why?
Thanks
- 14
- Visual C#.Net >> C# property usage questionHi,
I'm new to C#. Most examples about properties I found are sth like the
following:
class A{
private int property;
public int Property {
get { return property; }
set { property = value; }
}
}
My question is, Can I simply do the following:
class A {
public int Property;
}
Then later, if it turns out that I need to do sth when the property is set
or get, I change it to
class A{
public int Property {
get { <do sth>; return ... }
set { <do sth>; }
}
}
This way, the code that uses A should still compile. Am I right? This way
sounds much simpler to me, you don't have to write those repetitive get&set
unless you later find out that you need. Is this the right way of using
properties? Am I missing sth here?
thanks
vh
- 15
- Visual C#.Net >> accesing Form1:controls from other classHello
I have Form1 : System.Windows.Forms.Form and some public controls in it:
public System.Windows.Forms.ComboBox comboBox1;
public System.Windows.Forms.ComboBox comboBox2;
in the same project i have some other files with some otherclasses.
Can i access any of theese controls from that other classes ?
How ?
Thanx
|
|
|