.net supported OS
i would like to know what are the dotnet languages are avilable and what are
the dotnet languages are going to be released by microsoft or other 3-party
members.
apart from windows is there any OS version avilable for .net framework. Tag: System.IO.File.Move Tag: 80856
dotnet supported OS and languages
i would like to know what are the dotnet languages are avilable and what are
the dotnet languages are going to be released by microsoft or other 3-party
members.
apart from windows is there any OS version avilable for .net framework. Tag: System.IO.File.Move Tag: 80854
Can return GenericPrincipal from Web Services?
Hi,
Can I return GenericPrincipal from Web Services?
The following error displays when I try to return GenericPrincipal from Web
Services.
System.Security.Principal.GenericPrincipal cannot be serialized because it
does not have a default public constructor.
Thanks. Tag: System.IO.File.Move Tag: 80853
Netscape problem
Hi,
I have a problem with Netscape. I am using javascript to pass values and
redirecting to the same place. it works fine in IE and not in netscape.
please suggest.
function popup(WardrobeSet)
{
document.forms(0).action = "WardrobeSet.aspx?WardrobeSet=" + WardrobeSet;
document.forms(0).submit();
}
Please Advice,
Stephen. Tag: System.IO.File.Move Tag: 80846
Calling base implementation from base class?
Is there a way to call a base class implementation of a protected method
when Here's the scenario:
class MyApp
{
public static Main()
{
D obj=new D();
obj.Method1();
}
}
class B
{
protected void Method1()
{
}
protected void Method2()
{
//I want to call B's implementation of Method1 even though I'm
running as D's implementation of Method2;
//conceptually I want to do: this.base.Method1();
}
}
class D : B
{
override protected void Method1()
{
Method2();
}
}
Is this doable?
TIA
</joel> Tag: System.IO.File.Move Tag: 80842
Parallel Installation of .Net Framework 1.1 and 2.0 possible?
Hi,
Is it possible to have both Framework Versions installed on a sinlge
Machine? I couldn't find any information on this @ the MS site.
Thanks in advance,
Matthias Tag: System.IO.File.Move Tag: 80831
SaveFileDialog - get the remembered path before displaying.
OK. Whenever you display a SaveFileDialog it automatically displays
the last folder you were in the last time a save was done.
Is there a way you can get that folder before displaying it? I can't
see anything. The InitialDirectory and FileName properties are ""
when you start out. But then when you display the dialog, it knows
the last place.
Is there a way to get it before displaying it?
Thanks... Tag: System.IO.File.Move Tag: 80825
ImageList.Add () - Could this be a Bug ?
Hi!
I have an ImageList object with one image added with VS Designer. Then,
within my code I'am trying to add some other image to the collection:
int i = imageList1.Images.Add (myImage, Color.White) ;
this throws OutOfMemoryException! imageList1 contains only one bitmap (32x32
24bit), image with the same size I wish to append, and White is selected as
the ImageList.TransparentColor.
When I use another variant of Add() method, everything works fine:
imageList1.Images.Add (myImage) ;
Why does it happen ?.. I did something wrong, or it just a CCL bug ?..
Paul Tag: System.IO.File.Move Tag: 80820
memory usage on terminal server
I have a question about memory usage for compiled code of .net application.
I think that traditional DLL or EXE code is loaded into memory only once and
it's shared between processes and/or sessions.
However, i am not sure if this mechanism can be used for .net applications.
because from EXE or DLL file is loaded only MSIL code and this is JIT
compiled in memory. And my question is if this compiled code is shared
between processes too. I tried to find an article about this on MSDN, but i
couldn't. so if you know something useful then let me know.
I need to know this, because of of deploying .net applications to terminal
server. And i would like to know, if it is better to write unmanaged code for
terminal server, or for example use ngen.exe to precompile an application.
thank you in advance
Rasto Novotny Tag: System.IO.File.Move Tag: 80812
Changing a DataTables Schema
Is it possible to use a DataAdapter to fill a DataTable, change the
DataColumns of that DataTable (and maybe even it's name) and then commit
those changes to the database (in my case SQL Server 2000)?
Eg:
[VB.NET]
Dim dc As New SqlCommand("SELECT TOP 0 * FROM SomeTable",
SomeSqlConnection)
dc.CommandType = CommandType.Text
Dim da As New SqlDataAdapter(dc)
Dim dt As New DataTable
da.FillSchema(dt, SchemaType.Source)
dt.TableName = "NewTableName"
dt.Columns("SomeColumn").ColumnName = "NewName"
dt.Columns("AnotherColumn").DataType = GetType(String)
dt.Columns.Add("NewColumn", GetType(Integer))
da.Update(dt)
[C#]
SqlCommand dc = new SqlCommand("SELECT TOP 0 * FROM SomeTable",
SomeSqlConnection);
dc.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(dc);
DataTable dt = new DataTable();
da.FillSchema(dt, SchemaType.Source);
dt.TableName = "NewTableName";
dt.Columns["SomeColumn"].ColumnName = "NewName";
dt.Columns["AnotherColumn"].DataType = Type.GetType("System.String");
dt.Columns.Add("NewColumn", Type.GetType("System.Integer"));
da.Update(dt); Tag: System.IO.File.Move Tag: 80811
MailMessage and address book entries
Hi,
I am using the System.Web.Mail.MailMessage class to generate and send email
messages from my asp.net web app. I assumed that this was some simple
interface to send mail using SMTP, but in the documentation for the "To"
property it says:
"Recipients in the semicolon-delimited list can be either email addresses or
address book display names"
Can someone explain to me what "Address book" means in this context? I can't
find any other reference to address books in the framework documentation. Is
there some kind of behind-the-scenes integration with outlook or exchange?
Andy Tag: System.IO.File.Move Tag: 80804
Invalid http request for .NET control
Hi,
I have a web page with a reference to a .NET control and I am getting a
number of extraneous requests occurred that are related to the control
To Digress
=======
The html page contains a object tag that references a .NET control.
<object id="mycontrol"
class="http://server/virtualdirectory/mycontrol.dll#mycontrol"></object>
The control is downloaded and displayed on the page. Please note: The
control is always successfully displayed.
The problem
=========
Over ADSL, the request for the page seems to take a long time. When I used
Ethereal to pack sniff the http traffic, I discovered that 10 invalid
requests had been made to find the control. these range from
http://server/mycontrol.dll
to
http://server/mycontrol/mycontrol.exe
to
http://server/bin/mycontrol/mycontrol.dll
The last request is usually the correct
http://server/virtualdirectory/mycontrol.dll
Each request takes x seconds and the response is usually over 1500 bytes
(file not found response). Hence the delay in downloading the page over
ADSL.
The Question
=========
Has anyone encountered this problem before and is there a way to stop it
from happenning
Thanks in Advance
Mark Tag: System.IO.File.Move Tag: 80802
weird behavior ( browser or C# )
I have a problem with a new C# DHTML chat server I am making. First I'll
describe the problem and then ill post the code.
When I open 3 new instances of IE and connect the first client to
localhost:9999 the first client status bas only displays:
"opening page http://localhost:9999"
It does not display "1" as expected. But when the 2nd client connects the
1st client displays "2" and the 2nd client displays "opening page......"
Only when the 3rd client connects the 2nd client displays "2" in the status
bar the first client displays "3" in the status bar and the 3rd client
displays "1" in the status bar ( because the server now stoped listening and
the program terminated. )
But when I restart the server and reuse the same 3 clients ( without closing
them and opening new instances of IE ) the first client after connecting
displays "1" in the status bar imediately ( as should be ).
when connecting the 2nd client it imediatly displays "1" in the status bar
and the 1st client dispays "2" in the status bar and when i connect the 3rd
client the first client displays "3", the 2nd "2" and the 3rd "1" in the
status bar.
Why is this behavior. On Netscape the behaviour is somewhat similar.
this is the C# code.
// console application
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Collections;
using System.IO;
using System.Text;
namespace AtomHTTPresponse
{
class AtomHTTPresponse
{
private const int MAX_CONNECTIONS = 3;
private ArrayList prArrayListHTTPpipes = new ArrayList();
private TcpListener prTcpListener = new TcpListener(
IPAddress.Parse( "127.0.0.1" ), 9999 );
static void Main(string[] args)
{
AtomHTTPresponse lAtomHTTPresponse = new AtomHTTPresponse();
Thread lThreadListener = new Thread( new ThreadStart(
lAtomHTTPresponse.ListenerHandler ) );
lThreadListener.Start();
}
private void ListenerHandler()
{
prTcpListener.Start();
for ( int lCntOuter = 0; lCntOuter < MAX_CONNECTIONS;
lCntOuter++ )
{
//lock ( this )
//{
Thread lThreadListener = new Thread( new
ThreadStart( ConnectionHandler ) );
lThreadListener.Start();
//}
}
}
private void ConnectionHandler()
{
TcpClient lTcpClient =
prTcpListener.AcceptTcpClient();
NetworkStream lNetworkStream = lTcpClient.GetStream();
StreamReader lStreamReader = new StreamReader(
lNetworkStream );
StreamWriter lStreamWriter = new StreamWriter(
lNetworkStream );
HTTPpipe lHTTPpipe = new HTTPpipe( lTcpClient,
lNetworkStream, lStreamReader, lStreamWriter );
prArrayListHTTPpipes.Add( lHTTPpipe );
lHTTPpipe.WriteToCLient( "<script
language=\"javascript\">window.status = 0</script>" );
for ( int lCntInner = 0; lCntInner <
prArrayListHTTPpipes.Count; lCntInner++ )
{
( prArrayListHTTPpipes[ lCntInner ] as HTTPpipe
).WriteToCLient( "<script language=\"javascript\">window.status = parseInt(
window.status ) + 1</script>" );
}
}
}
class HTTPpipe
{
public TcpClient puTcpClient;
public NetworkStream puNetworkStream;
public StreamReader puStreamReader;
public StreamWriter puStreamWriter;
public char[] puArrCharRequest = new char[256];
static string cStrResponse = "<script
language=\"javascript\">window.status = 0</script>";
static string cStrHTTPheader = "HTTP/1.1 200 OK\r\n"
+ "Server: Microsoft-IIS/5.0\r\n"
+ "Date: Wed, 9 jan 2004 19:59:09 GMT\r\n"
+ "X-Powered-By: ASP.NET\r\n"
+ "Content-Type: text/html\r\n"
+ "Set-Cookie: ASPSESSIONIDASQSSARR=CCOBBLCBOLKOECFIANBGOBAI;
path=/\r\n" // let it be for now. redundancy will be removed at a later time
+ "Cache-control: private\r\n\r\n";
public HTTPpipe( TcpClient iTcpClient, NetworkStream
iNetworkStream, StreamReader iStreamReader, StreamWriter iStreamWriter )
{
puTcpClient = iTcpClient;
puNetworkStream = iNetworkStream;
puStreamReader = iStreamReader;
puStreamWriter = iStreamWriter;
puStreamReader.Read( puArrCharRequest, 0,
puArrCharRequest.Length ); // do nothing with the request but now we know we
dont send a response before the request has been fully received.
WriteToCLient( cStrHTTPheader );
WriteToCLient( cStrResponse );
}
public void WriteToCLient( string iStrResponse )
{
puStreamWriter.Write( iStrResponse );
puStreamWriter.Flush();
}
public void Close()
{
puTcpClient.Close();
}
}
} Tag: System.IO.File.Move Tag: 80799
How can you highlight or disable a selection in a listbox
I need disable or highlight a selection in a listbox to indicate that it has
been selected before. I can already determine what values wereselected by
storing those values in a stateview. Yet, how can I disable or point out
those values were previously selected in a listbox and recorded. Tag: System.IO.File.Move Tag: 80793
Multiple References and Object Instantiation??
I am working on a application that has many custom made dlls. Actually, for
this app each dll is a different form. I am able, with no problem to
reference and instantiate them to use their public properties and methods
with no problem. But, if one dll is trying to access another dll's
properties (this does not work very good) the project tries to copy the dll
to the directory which already contains the dll and the app will not
compile. I have tried different ways to work around this, ie.
Create a Class that instantiates all the forms from the dlls and reference
the Class from whatever needs them. I can reference them just fine but
cannot instantiate anything. Basically I am referencing a reference from a
reference.
Is there a way to Globally include all the dll's in the project using a
config file or something so that once the dll is referenced, it is
accessible by everything that is referenced from the Main App and Eachother?
I don't believe this is very efficient and would greatly appreciate any
suggestions, on better ways to accomplish this. The basic plan is to have
all the forms independant of the Main App so that if a single form is
changed all that is needed is to updated is the corresponding dll.
Thanks,
Chuck Tag: System.IO.File.Move Tag: 80791
Runtime Security Policy question
I THOUGHT I COULD BLOCK CODE ACCESS SIMPLY BY RESTRICTING ACCESS VIA THE
FRAMEWORK CONFIGURATION MANAGER. MY EXPERMENT BELOW HAS CONFUSED ME.
I attributed a DLL called "Filer" at the assembly level as follows:
[assembly:FileIOPermission(SecurityAction.RequestMinimum,Unrestricted=true)]
The Filer.dll contains a class called FileOpener.
I compiled "Filer.dll" and referenced it from a Windows Form Project.
In Framework Config Tool, I created a Code Group named "Test" as a child of
the "All Code" code group at the Machine Level, Imported Filer.dll with a
Hash Membership Condition, set Policy Level to Exclusive, and set the
Permission Set to the "Nothing" Permission Set. I tested the Permission Level
with the "Evaluate Assembly" option and was informed I had no Permissions.
AS EXPECTED, I ran the form and got an
System.Security.Policy.PolicyException when I instantiated the
Filer.FileOpener class.
I THEN REMOVED THE FILER.DLL ATTRIBUTE mentioned above
([assembly:FileIOPermission( SecurityAction.RequestMinimum,
Unrestricted=true)])
...from the Filer.dll and recompiled, rereferenced in the Form app, in
Framework Config tool, reImported the Test Code Group hash membership
condition and left all other Security Policy settings the same. I tested the
Permission Level with the "Evaluate Assembly" option and was informed I had
no Permissions.
AS UNEXPECTED, I ran the form and DID NOT get an
System.Security.Policy.PolicyException when I instantiated the "filer.dll"
FileOpener class. In fact I got no Exception!
I would expect no exception if I had made a mistake in reImporting the
Filer.dll in the Framework Config Tool, but I didn't. In fact I reversed the
process by reattributing the Filer.dll, recompiling, rereferencing in the
Form app, in Framework Config tool, reImported the Test Code Group hash
membership condition and left all other Security Policy settings the same. I
tested the Permission Level with the "Evaluate Assembly" option and was
informed I had no Permissions.
AS EXPECTED, I ran the form and got an
System.Security.Policy.PolicyException when I instantiated the
Filer.FileOpener class.
This leads me to believe that FRAMEWORK CONFIGURATION MANAGER Runtime
Security Policy settings do not affect components that have not been
attributed to request Permissions...and instead Permission Calculation only
comes into play when code has been attributed with permission requests.
This goes against what I read about the subject. Can you see what I am
missing? Tag: System.IO.File.Move Tag: 80788
Problems adding a reference with COM --converting to type .NET assembly failed
Hello--
I'm in the process of coverting a VB6 app to VB.NET. My VB6 app is a
help desk program, which scans a mailbox that we have set up for our
help desk. We use Novell Groupwise and in my VB6 app, I added a
reference to the Groupwise type library--no problem. But when I try
to add a reference in .NET, the Groupwise library shows up in the COM
list and when I go to add it, I get an error message saying:
"A reference to GroupWare type library' could not be added.
Converting the type library to a .NET assembly failed. Could not load
type GroupwareTypeLibrary.DocumentType2Class from assembly
Interop.GroupwareTypeLibrary, version 1.0.0.0."
The reading I've been doing for the better part of a day suggests that
the .dll needs to be registered with the GAC. I tried using
regasm.exe but got a message saying it failed to load because it's not
a valid .NET assembly.
I don't know what I'm supposed to do to be able to get this reference
added. Any help would be appreciated.
Thanks.
Molly J. Fagan
Oklahoma Foundation for Medical Quality Tag: System.IO.File.Move Tag: 80782
How to set value of <INPUT type=file...> element programmatically?
This is a multi-part message in MIME format.
------=_NextPart_000_0012_01C484AE.304460A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi ALL.
I need to simulate send POST data ( - file upload) as it was submitted =
in Browser. In C# I create instanse of IE, navigate to page with the =
form, fill in the fields and try to Submit by call submitButton.click() =
Unfortunately it does not work while file_filed.vale =3D <path_to_file> =
has no effect, value <INPUT type=3Dfile...> cound not be set from script =
of that HTML page. Is there another way to set that value by means of =
.NET ? Below the part of code :
SHDocVw.InternetExplorer ie =3D new SHDocVw.InternetExplorerClass();
object o =3D null;
ie.Navigate( url, ref o, ref o, ref o, ref o ); // navigate to page with =
the form and waiting for DownloadComplete
.............................................
mshtml.HTMLDocument doc =3D (mshtml.HTMLDocument)ie.Document;
mshtml.IHTMLInputFileElement file =3D =
(mshtml.IHTMLInputFileElement)doc.getElementsByName("file").item(null,0);=
file.value =3D m_sPathToFile; // has no effect!!!!!!!
mshtml.HTMLInputButtonElement btn =3D =
(mshtml.HTMLInputButtonElement)doc.getElementsByName("send").item(null,0)=
;
btn.click();
........................
Thank you for any help
Evgeny
------=_NextPart_000_0012_01C484AE.304460A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi ALL.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I need to simulate send POST data =
( -=20
file upload) as it was submitted in Browser. In C# I create =
instanse=20
of IE, navigate to page with the form, fill in the fields and try to =
Submit by=20
call submitButton.click() Unfortunately it does not work while =
file_filed.vale =3D=20
<path_to_file> has no effect, value <INPUT type=3Dfile...> =
cound not=20
be set from script of that HTML page. Is there another way to set that =
value by=20
means of .NET ? Below the part of code :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<P><FONT face=3D"Courier New" size=3D2>SHDocVw.InternetExplorer ie =3D =
new=20
SHDocVw.InternetExplorerClass();<BR></FONT><FONT face=3D"Courier New"=20
size=3D2>object o =3D null;<BR></FONT><FONT face=3D"Courier New" =
size=3D2>ie.Navigate(=20
url, ref o, ref o, ref o, ref o ); // navigate to page with the form and =
waiting=20
for DownloadComplete<BR></FONT><FONT size=3D2></FONT></P>
<P><FONT size=3D2><FONT=20
face=3D"Courier =
New">.............................................<BR></FONT></P></FONT>
<P><FONT face=3D"Courier New" size=3D2>mshtml.HTMLDocument doc =3D=20
(mshtml.HTMLDocument)ie.Document;<BR></FONT><FONT face=3D"Courier New"=20
size=3D2>mshtml.IHTMLInputFileElement file =3D=20
(mshtml.IHTMLInputFileElement)doc.getElementsByName("file").item(null,0);=
<BR></FONT><FONT=20
face=3D"Courier New" size=3D2>file.value =3D m_sPathToFile; // has no=20
effect!!!!!!!<BR></FONT><FONT face=3D"Courier New"><FONT=20
size=3D2>mshtml.HTMLInputButtonElement btn =3D=20
(mshtml.HTMLInputButtonElement)doc.getElementsByName("send").item(null,0)=
;<BR></FONT><FONT=20
size=3D2>btn.click();</FONT></FONT></P>
<P><FONT face=3D"Courier New" =
size=3D2>........................</FONT></P>
<P><FONT face=3D"Courier New" size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2>Thank you for any help</FONT></P>
<P><FONT face=3DArial size=3D2>Evgeny</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0012_01C484AE.304460A0-- Tag: System.IO.File.Move Tag: 80781
Additional information: Exception has been thrown by the target of an invocation.
Hi,
I have .dll with Form and ImageList component,
when I'm making instance, I got execption:
An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
at line:
this.imglToolBar.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglToolBar.I
mageStream")));
What is wrong?
thx in andvance
pawel Tag: System.IO.File.Move Tag: 80777
Add a DLL to GAC
Hi All,
I added a DLL written by VB.NET to GAC. This DLL is
located at C:\LLSI-Tech\GAC in my local computer.
The project(project1) for above DLL is located at
C:\clearcase\payoff.
I add this DLL to my another VB class project(project2) as
an reference from C:\LLSI-Tech\GAC.
However, the path for the DLL changes from C:\LLSI-
Tech\GAC to C:\clearcase\payoff\bin after I rebuild
project2.
Does anybody can tell me what is going on.
Thank you in advance !
Hi All,
I added a DLL written by VB.NET to GAC. This DLL is
located at C:\LLSI-Tech\GAC im my local computer.
The project(project1) for above DLL is located at
C:\clearcase\payoff.
I add this DLL to my another VB class project(project2) as
a reference from C:\LLSI-Tech\GAC.
However, the path for the DLL changes from C:\LLSI-
Tech\GAC to C:\clearcase\payoff\bin after I rebuild
project2.
Does anybody can tell me what is going on.
Thank you in advance !
My email address is ningsheng.xu@litton.c-bass.com
Nelson
Nelson Tag: System.IO.File.Move Tag: 80774
OutOfMemoryException was thrown
Hello everyone,
I wrote a web service that monitorizes some directories and their
contents. It returns a XML document as string.
A web application calls this web service and parses the XML to display
the status of directories graphically. It worked fine on Windows 2000.
Then I transfered the web application on Windows 2003 and an
OutOfMemoryException is thrown when there are too many files. Note
this number of files excedeed is very low (order of 20).
The web service still works on Windows 2003, but the web application
causes the faults. The virtual memory settings are the same on 2000 e
2003.
Thanks in advance,
Gionni Tag: System.IO.File.Move Tag: 80767
Serializing private members of a class
I have a private instance of a object in a class i wish to include in the
output of class serialization. The object is private because the contents
cannot be modified outside the class but it is important that the contents of
this private member are retained when the class is serialised. Can anyone
tell me how i can include this private object instance into the serialised
output. I know there are a number of xmlattributes you can apply to classes
and class members, but i can't seem to find one that will allow me to do what
i want.
Thanks Tag: System.IO.File.Move Tag: 80756
Weird IE behavior
Hi all,
I am trying to make a very efficient C# DHTML chat server. But even the
responding to clients bogles me. I will post the code after I have described
the problem:
When i open 3 new instances of IE and connect the first client to
localhost:9999 all the status bar displays is:
"opening page......."
It does not display "1" as expected. But when the 2nd client connects the
1st client displays "2" and the 2nd client displays "opening page"
Only when the 3rd client connects the 2nd client displays "2" the first
client displays "3" and the 3rd client displays "1" ( because the programm
now terminated. )
But when I restart the client and reuse the same 3 clients ( without closing
them and opening new instances of IE ) the first client after connecting
displays "1" imediately ( as should be ).
when connecting the 2nd client it imediatly displays "1" and the 1st client
dispays "2" and so on and so on.
Is IE or C# so fucked up or am I doing something wrong?
// console application
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Collections;
using System.IO;
using System.Text;
namespace AtomHTTPresponse
{
class AtomHTTPresponse
{
private const int MAX_CONNECTIONS = 3;
private ArrayList prArrayListHTTPpipes = new ArrayList();
private TcpListener prTcpListener = new TcpListener( IPAddress.Parse(
"127.0.0.1" ), 9999 );
static void Main(string[] args)
{
AtomHTTPresponse lAtomHTTPresponse = new AtomHTTPresponse();
Thread lThreadListener = new Thread( new ThreadStart(
lAtomHTTPresponse.ListenerHandler ) );
lThreadListener.Start();
}
private void ListenerHandler()
{
prTcpListener.Start();
for ( int lCntOuter = 0; lCntOuter < MAX_CONNECTIONS; lCntOuter++ )
{
//lock ( this )
//{
Thread lThreadListener = new Thread( new ThreadStart( ConnectionHandler
) );
lThreadListener.Start();
//}
}
}
private void ConnectionHandler()
{
TcpClient lTcpClient = prTcpListener.AcceptTcpClient();
NetworkStream lNetworkStream = lTcpClient.GetStream();
StreamReader lStreamReader = new StreamReader( lNetworkStream );
StreamWriter lStreamWriter = new StreamWriter( lNetworkStream );
HTTPpipe lHTTPpipe = new HTTPpipe( lTcpClient, lNetworkStream,
lStreamReader, lStreamWriter );
prArrayListHTTPpipes.Add( lHTTPpipe );
lHTTPpipe.WriteToCLient( "<script language=\"javascript\">window.status =
0</script>" );
for ( int lCntInner = 0; lCntInner < prArrayListHTTPpipes.Count;
lCntInner++ )
{
( prArrayListHTTPpipes[ lCntInner ] as HTTPpipe ).WriteToCLient(
"<script language=\"javascript\">window.status = parseInt( window.status ) +
1</script>" );
}
}
}
class HTTPpipe
{
public TcpClient puTcpClient;
public NetworkStream puNetworkStream;
public StreamReader puStreamReader;
public StreamWriter puStreamWriter;
public char[] puArrCharRequest = new char[256];
static string cStrResponse = "<script
language=\"javascript\">window.status = 0</script>";
static string cStrHTTPheader = "HTTP/1.1 200 OK\r\n"
+ "Server: Microsoft-IIS/5.0\r\n"
+ "Date: Wed, 9 jan 2004 19:59:09 GMT\r\n"
+ "X-Powered-By: ASP.NET\r\n"
+ "Content-Type: text/html\r\n"
+ "Set-Cookie: ASPSESSIONIDASQSSARR=CCOBBLCBOLKOECFIANBGOBAI; path=/\r\n"
// let it be for now. redundancy will be removed at a later time
+ "Cache-control: private\r\n\r\n";
public HTTPpipe( TcpClient iTcpClient, NetworkStream iNetworkStream,
StreamReader iStreamReader, StreamWriter iStreamWriter )
{
puTcpClient = iTcpClient;
puNetworkStream = iNetworkStream;
puStreamReader = iStreamReader;
puStreamWriter = iStreamWriter;
puStreamReader.Read( puArrCharRequest, 0, puArrCharRequest.Length ); //
do nothing with the request but now we know we dont send a response before
the request has been fully received.
WriteToCLient( cStrHTTPheader );
WriteToCLient( cStrResponse );
}
public void WriteToCLient( string iStrResponse )
{
puStreamWriter.Write( iStrResponse );
puStreamWriter.Flush();
}
public void Close()
{
puTcpClient.Close();
}
}
} Tag: System.IO.File.Move Tag: 80753
The underlying connection was closed - Remoting.Channels.Http.HttpClientTransportSink
Hi,
I got this error. I search the web and found a long disscus and
solutions for example at http://p2p.wrox.com/topic.asp?TOPIC_ID=4858
the problem I use remoting and not webservie. I dont have
reference.cs file. do you have any solution? which function to
overload ? wehre?
TIA
Gilad
System.Net.WebException: The underlying connection was closed: An
unexpected error occurred on a receive.
Server stack trace:
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessResponseException(WebException
webException, HttpWebResponse& response)
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage
msg, ITransportHeaders requestHeaders, Stream requestStream,
ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage
msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type) Tag: System.IO.File.Move Tag: 80752
Accessing mapped drives from Framework 1.1 & COM+
I have a COM+ application that was written using Framework 1.0 and runs on
Windows 2000. The COM+ app runs as domain user who has access to certain
network shares. These shares are mapped on the server. There is no issue on
Windows 2000.
I installed the same app on Windows 2003 without installing Framework 1.0.
Now the application says it cannot find the mapped drive.
Do I need to change some configuration?
Thanks.
James Tag: System.IO.File.Move Tag: 80736
how to make an object readonly in runtime?
I have some data in a DataTable object that I'd like to put into a static
class for the entire app to use, kind of like a cahced global value. The
data in there should not change, but DataTable by default can be changed.
Is there an easy way to make it read only. I can probably create my own
wrapper class to accomplish this but hopefully there is a way to do this
directly on the DataTable.
Thanks in advance for any help
Bob Tag: System.IO.File.Move Tag: 80721
frame work for linux
Im looking for a framework for linux if available because
after i wrote the site i heard they use linux and need me
to wroke in perl or cgi Tag: System.IO.File.Move Tag: 80710
looking for sample:multiple view single document in C# or VB
Hi,
I am looking for sample of an application similar to outlook regarding UI
when user select a tree node in the left pane a view is changed in the right
pane
(it does not necessarily support MFC doc view architecture )
thanks in advance Tag: System.IO.File.Move Tag: 80702
Best practice to lock DB SQLServer records in VB.NET application
Hi all;
I wonder if you have an opinion about this matter:
Besides using "Version Number Approach" and "Saving All Values
Approach"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskPerformingOptimisticConcurrencyChecking.asp
suggested by MS for solving lock problems, is there any other options
to do this? In my opinion there's one limitation in these methods: if
you loose your connection to your db for some reason while comitting
the transaction, how can you be sure the lock is in the rigth state?
Can you use threads to lock and unlock records? If so, can someone
point me to some kind of a sample or tutorial to learn more about it?
Urgent!
Thanks in advance! Tag: System.IO.File.Move Tag: 80697
Type.GetType Access is denied
Hello,
The .NET application I have just installed at a client web site is throwing
a strange error. At first the applications works without any problems, but
after 10 mins or so Access denied error messages are thrown.
The application, web based, late binds to a series of assemblies, none of
which are in the GAC. I have configured the application to impersonate the
IIS user and have set the user to have access to all relevant directories
(wwwroot, wwwroot/bin, Microsoft.Net/framework/v1.1.4322) and disabled the
index services service.
After digging a little deeper it seems the error is thrown when calling
Type.GetType, but like I mentioned earlier everything works fine but then
suddenly dies.
Can anybody think why this is the case and what I can do to resolve this
irritating problem.
Thanks
Richard. Tag: System.IO.File.Move Tag: 80690
Oracle NET Maximum Connections reached
I am using Data.OracleClient.Dll version 1.0.1012.0 and closing the
connections in code using .close
but i still get the "Maximum connections reached" message and the
oracle server shows idle inactive connections for aspnet
The connection string used is
"Data Source=DEV001.SRV01;password=test;user id=test;Max Pool
Size=10;Min Pool Size=10"
Should i drop the use of Microsoft .NET Oracle provide and use Oracle
Net Provider, or aparently this is a know problem and microsoft has a
hotfix but i don't know where to download this from ?
any help would be greatly appreciated
Thank You Tag: System.IO.File.Move Tag: 80689
Microsoft's DNP for Oracle. HELP!! (sorry for the x-post)
Hello all,
I am currently working on a project that uses MS's .net provider for
Oracle. Now, here is where it gets WEIRD!!!
for some reason when we run it in VS.NET's IDE it is fine, a previous build
deployed (xcopy) onto a test PC is fine. However; when we have recently but
a new build on it doesn't work. The only thing (and I ain't buying it) that
my work mate says it is down to is that the path of the EXE has brackets in
it!!! When we remove the brackets it is fine (something ain't right)!!!!
Has anyone had a similar scenario or a explanation for this bizarre
behaviour????
Regards
Alan Seunarayan Tag: System.IO.File.Move Tag: 80686
httpwebrequest requeststream
I am posting to a cgi script using httpwebrequest but I have when problems
when of the parameters in the request stream has embedded spaces.
My old asp code successfully posted using a form action with fields such as
&name="Joe Jackson"
in .NET, if I pass this to the requeststream the cgi interprets some extra
double quotes
&name=""Joe Jackson""
If I leave off the quotes entirely the CGI script fails.
Does anybody know whats the best way to build the requeststream so that it
handles double quotes and spaces. Tag: System.IO.File.Move Tag: 80685
Serialized Hashtable
Hi
I've tried moving a serialized hashtable made in WinXP (std .Net
framework), to a PocketPC device (Compact Framework). I've ran in to all
kinds of problems, and have not been able to get this to work. The
problem is not in the actual filecopy.
I've tried the CompactFormatter
(http://www.freewebs.com/compactFormatter/) for binary serialization.
No luck when deserializing on the device. CF wont deserializa std
framework, vice versa.
I've tried XML serialization from opennetcf
(http://www.opennetcf.org/library/OpenNETCF.Xml.Serialization.html). Got
a problem since Hashtable implement IDictionary. For some reason.
Is there another way to do this? Is there a reason why this should not
work, or is it me who's doing this all wrong.
If Hashtable in std framework is differently implemented than the
Hashtable in CF, that would explain incompatibility when deserializing.
But is that the case?
Thanks,
Finn Tag: System.IO.File.Move Tag: 80684
cellphone bluetooth (serial) SMS receive
Hi,
does anyone know how to receive a sms from a cellphone in a c# application?
I use a Sony ericsson T610 on a bluetooth serial connection.
Thanks in advance
Jan Tag: System.IO.File.Move Tag: 80682
Binary Compatibility equivalent in .NET ?
I have a client that insists that there be some sort of binary
compatibility equivalent in the .NET assemblies I'm producing
(converted from VB6 code). I understand their concern: while you
don't *need* binary compatibility since you can just plunk in newer
versions of assemblies (unlike in COM where the entire mess had to be
recompiled if you didn't use binary compatibility), you might want
some way to warn or prevent developers from making changes that may
break an app using the assembly. I think this was the other main
advantage of binary compatibility - it prevented thoughtless breaking
changes thrown in all over the place.
Any ideas? Tag: System.IO.File.Move Tag: 80657
FileLen reports wrong file size
1. A function starts an unknown external program.
2. The external program starts writting a file.
3. The function should report the size of the file being written by the
external program.
How to achieve the 3rd point using .net framework 2003 only?
Notes:
for a certain external program
.Net's FileLen reported file size is allways 0 until the file is
closed.
Microsoft Scripting Runtime's
FileSystemObject.GetFile(FileName).Size retports the correct file size
while it is being written.
VB Tag: System.IO.File.Move Tag: 80650
Shared Static Variables in vb.net please?
Does anyone know if MS has / is planning to introduce a shared static local
variable to VB.net? I have had a few instances now where I thought this would
be a tidy way to write some code.
i.e. an instance method needs to access a shared (class) variable, and it is
the only method that needs to access it.
I really like the concept of static variables in vb.net, they make class
definitions a lot tidier I think. Just a shame they called the keyword
"static" as seems to confuse people.
Cheers. Tag: System.IO.File.Move Tag: 80649
Bug in timers.timer ?
Hi,
Maybe Iâ??m doing something wrong but I canâ??t know what.
Iâ??m using timers in my applications to do things after n seconds after do
any other thing.
Symptoms:
After a random time the Elapse event just stop to be raised. I tried to
debug and found something curious: Although I specified AutoReset property to
False, at some time in the Elapse event the Enabled property came at value of
True!!! After that happen, the Elapse event simply stop to rise. That means
that my host applications freeze will waiting some work to be done based on
that event.
Please analyze this problem. I created a simple example that demonstrates
that problem. The code is below this message. Just run it in debug mode,
click Start button and wait till form turn red. At that time the problem I
mentioned just happened. You can insert a breakpoint just after â??If
T1.Enabled Thenâ?? line at â??T1_Elapsedâ?? sub and just after â??If T2.Enabled Thenâ??
line at â??T2_Elapsedâ?? sub to analyze what is happening.
I couldnâ??t found an exact time that happened, so you can just start my
example application and do other things while wait form turn red, or
application stop at your break points.
In my example I had a button to restart timer after it stops raising events.
It seams that to restart raising Elapse events is just needed to set Enabled
property to false and call start againâ?¦ But this behavior is not good!
If I start many instances of this example app, them the error appears more
offen.
Is that a bug?
Pedro Gonçalves
Example code:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents lblCounter1 As System.Windows.Forms.Label
Friend WithEvents lblCounter2 As System.Windows.Forms.Label
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.lblCounter1 = New System.Windows.Forms.Label()
Me.lblCounter2 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(112, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Elapse Counter"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'lblCounter1
'
Me.lblCounter1.BorderStyle =
System.Windows.Forms.BorderStyle.FixedSingle
Me.lblCounter1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.lblCounter1.Location = New System.Drawing.Point(24, 56)
Me.lblCounter1.Name = "lblCounter1"
Me.lblCounter1.Size = New System.Drawing.Size(112, 24)
Me.lblCounter1.TabIndex = 1
Me.lblCounter1.TextAlign =
System.Drawing.ContentAlignment.MiddleCenter
'
'lblCounter2
'
Me.lblCounter2.BorderStyle =
System.Windows.Forms.BorderStyle.FixedSingle
Me.lblCounter2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.lblCounter2.Location = New System.Drawing.Point(160, 56)
Me.lblCounter2.Name = "lblCounter2"
Me.lblCounter2.Size = New System.Drawing.Size(112, 24)
Me.lblCounter2.TabIndex = 3
Me.lblCounter2.TextAlign =
System.Drawing.ContentAlignment.MiddleCenter
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(160, 32)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(112, 16)
Me.Label4.TabIndex = 2
Me.Label4.Text = "Elapse Counter"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(24, 96)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(248, 32)
Me.Button1.TabIndex = 4
Me.Button1.Text = "Start"
'
'Button2
'
Me.Button2.Enabled = False
Me.Button2.Location = New System.Drawing.Point(28, 136)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(108, 32)
Me.Button2.TabIndex = 5
Me.Button2.Text = "Start Timer"
'
'Button3
'
Me.Button3.Enabled = False
Me.Button3.Location = New System.Drawing.Point(160, 136)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(108, 32)
Me.Button3.TabIndex = 6
Me.Button3.Text = "Start Timer"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(304, 175)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button3,
Me.Button2, Me.Button1, Me.lblCounter2, Me.Label4, Me.lblCounter1, Me.Label1})
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private T1 As System.Timers.Timer
Private T2 As System.Timers.Timer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
T1 = New System.Timers.Timer()
T1.AutoReset = False
T1.Interval = 10
T1.SynchronizingObject = Me
AddHandler T1.Elapsed, AddressOf T1_Elapsed
T2 = New System.Timers.Timer()
T2.AutoReset = False
T2.Interval = 500
T2.SynchronizingObject = Me
AddHandler T2.Elapsed, AddressOf T2_Elapsed
T1.Start()
T2.Start()
Button1.Enabled = False
End Sub
Private Sub T1_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs) ' Handles T1.Elapsed
Static Counter As Integer
If T1.Enabled Then
' ????????????????
Me.BackColor = Color.Red
lblCounter1.BackColor = Color.LightYellow
Button2.Enabled = True
End If
Counter += 1
lblCounter1.Text = Counter
lblCounter1.Refresh()
T1.Start()
End Sub
Private Sub T2_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs) ' Handles T2.Elapsed
Static Counter As Integer
If T2.Enabled Then
' ????????????????
Me.BackColor = Color.Red
lblCounter2.BackColor = Color.LightYellow
Button2.Enabled = True
End If
Counter += 1
lblCounter2.Text = Counter
lblCounter2.Refresh()
T2.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
T1.Enabled = False
T1.Start()
Button2.Enabled = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
T2.Enabled = False
T2.Start()
Button3.Enabled = False
End Sub
End Class Tag: System.IO.File.Move Tag: 80638
propercase
ProperCase for normal usage is simple:
Dim s, s1, s2 As String
s = "DENNIS TURNER"
s1 = StrConv(s, VbStrConv.ProperCase)
Even with names it's simple Turner, Dennis
Turner, Mr. Dennis
But thereafter it can become more complicated:
Turner, Dennis Md
Turner, Dennis Phd
I can go through the 10 or 15 most likely suspects and handle them with
select case statements. However, I feel I am reinventing the wheel.
Somewhere, someplace, somebody must have created a class that already
handles a great number of these annoyances. I would appreciate being
directed to it.
Thank you.
Dennis Tag: System.IO.File.Move Tag: 80637
Function to access the encrypted filesystem.
From the explorer I can encrypt a file or directory using EFS. I would like
to do the same thing programatically. I want to write data to a file and have
it encrypted so that only I can read it. Is this possible using .NET?
Thank you.
Kevin Tag: System.IO.File.Move Tag: 80634
GetInvocationList - Getting the delegates wired up to an event
I'm wanting to retrieve a list of all the delegates that have resulted from
Events being wired up to my class.
I can see (and have been told) that "GetInvocationList" is the method to use
for this, but I can't see how, from within my class, I use this method to
achieve this. What is the delegate I'm calling GetInvocationList on??
Can someone show me what to do here please? Many thanks!
===
Phil
(Auckland | Aotearoa) Tag: System.IO.File.Move Tag: 80632
Simple question
Suppose I built an application using the .NET Framework 1.0 compiler.
Do I have to configure anything to make it run on higher versions? Tag: System.IO.File.Move Tag: 80627
installing IIS (Internet Info. Service)
I'll like to install VB.NET on my computer and do it right.
I have both: VB.NET (Standard) AND Visual Studio.NET (academic)
The book I have "warn" me:
"You must install IIS before installing VB"
So, before even placing any of those CD into my computer I'll like to know:
1. Does any of these have IIS
2. If yes, how to comply with the above warning.
3. If not - where do I get IIS
Thanks,
Uzi Tag: System.IO.File.Move Tag: 80609
is it possible
is it possible to write a tool like "netstat" and close
socket connections externally with .NET Framework
thanks,
parahat melayev Tag: System.IO.File.Move Tag: 80605
Socksified proxy ftp client ?
Hi,
I have written an FTP client in C# that communicates using sockets
(System.Net.Sockets.Socket that implements Berkeley sockets).
This does not work from behind authenticated proxies.
I have been given to understand that for the client to work from
authenticated proxies, i need to "Socksify" it.
What is this "Socksification" of client?
Any help in this direction is greatly appreciated.
Thanks in advance
regards
-Kumarforg Tag: System.IO.File.Move Tag: 80603
How to CreateDirectory to create a directory structure on a network drive
If I call CreateDirectory(\\\\devDriveA\\foo\\bar\\a\\b\\c) and
\\devDriveA\foo\bar already exists then sub directories a\b\c don't get
created. When I use CreateDirectory on my own file system, e.g.
CreateDirectory("c:\\a\\b\\c"); it works fine. Is there something that I
must do to get CreateDirectory to work on network drives? Tag: System.IO.File.Move Tag: 80599
why does System.IO.File.Move("c:\\hmbug.jpg", "c:\\foodoo\\foo.jpg"); throw
access denied? im just moving a file in a console app? any ideas?