Mitch Walker - MSFT's Q&A profile
.NET Development Secure my assembly
How can I secure my assembly so that no other app can access it Thanks Thanks. You are the first that give me an answer (i've posted within a lot of forums). Can U provide me a simple code source pls ...Show All
.NET Development Problem with Socket.SendFile,transfer file from client to client (c#)
I make chat program with multiple user connect to server with socket. Everything seem great except the last module that made I confuse. How can I send any file(doc,zip,xml,exe, jpg,gif,bmp... I don't know what file type that client want to send ) from client to client or from client to server I read about streamreader/streamwriter and I understand that it's for text file,right I read in msdn about Socket.SendFile with example Socket.SendFile (String, Byte[], Byte[], TransmitFileOptions) But I didn't see any example when I want to receive file such as Socket.ReceiveFile() Now I confuse that How to receive file and how I know which one is file and which one is message because I have Socket.receive() to receive message ...Show All
Visual C++ Getting garbage setting dialog box text
Hi Folks; I'm trying to set the text of a dialog box with SetDlgItemText. As an example I'm trying: SetDlgItemText(hwnd, IDC_F1, "Some text"); where IDC_F1 is defined as the ID for an edit box. What I'm getting is just garbage and I thought maybe it was my font but I've set it do Courier New, size 8 which I thought was pretty standard. Maybe someone could shed some light on my sitation. Do you need Unicode for other parts of your software, e.g. localization If not, you can simply switch your project to build for multibyte, and continue to use the char CompName with SetDlgItemText , without any conversion. To do this, go to Project > Properties (bottom item) > Configuration properties > General , and swi ...Show All
.NET Development Oracle Float data type in .Net
I ran into the following issue and wondering whether or not any body has an explanation for it. A value of 8.45 is stored in a FLOAT data type column in the exact same schema on two different databases. While it is retrieved (thru OracleDataAdapter) and displayed, the same client showed 8.45 from one database and 8.499999999999 from other database. Keep in mind that the same .NET code, schema (two different databases) with the same data is used here. After I altered the data type from FLOAT to NUMBER, without defining any precision or scale, issue is resolved and 8.45 is always returned and shown when pointing to either database. Does the FLOAT data type is the cause of this problem Any help is greatly appreciated. ...Show All
Visual Studio Express Editions hot to use 2 data values in one combobox
hey i have here one problem, i use combobox, i bind datasource to it, and i want the effect that combobox will display for example customers name, but in reallyty its displaying customers id. for example we have here to data columns string custName and int custId. so the to columns are binded to comboboxm and the effect i want is that when user selects diferrenr customer from combobox he sees only customers name, but program sees not customers name but that other column custId. maybe someone will want to help ;) well thanks now i am reading about datamember and valuemeber what i am doing is actualyy this: // 2 columns in customers table custName as string and custID as int bs = new BindingSource (); ds = new DataSet (); ...Show All
Windows Forms Put a glass panel over form while processing?
Dear all What i would like to achieve is placing something like a glass panel over the form while is doing some processing and show a proress bar. Little something like that , which would informa the user that something is happening:) Any ideas or advice Is there any code examples Cheers theblueeyz wrote: Oh, I know that it's not meant as an interactive control. What I meant was, the first time I make it visible, I clearly redraws itself about 5 or 6 times before it settles down. After that, subsequent Visible = true calls are fine. It seems to have alot to do with the alpha blending. The lower the alpha, the greater its apparent need to redraw. I don't see Flickering, but I do see an obvious Paint ...Show All
.NET Development Updating a field in a table
I'm looking to update a field in a table in my MS Access database. I'm creating a rental program so when the item is returned it will insert the date that the item was returned. At present the field(date_returned) does not have anything in it. This is the cose i have at present: Public Sub Add(ByVal cdr As String) sql = "UPDATE Rentals SET date_returned = @date_returned WHERE cd =" & cdr Try If conn.State = ConnectionState.Open Then conn.Close() End If Dim command As New OleDb.OleDbCommand(sql, conn) command.Parameters.Add("@date_returned", Date.Now) conn.Open() command.ExecuteNonQuery() conn.Close() 'MessageBox.Show("", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch ex As Exception End Try End Sub At the underlined line i'm ...Show All
Windows Forms Type on DataGridView Search
Hi I want to enable a search function where the user can select a column (highlight) and simple type the required search in on the DataGridView. I am using Visual Studio 2005 C# If anyone has any ideas that would be great. Thanks I hope this article will help you http://www.codeproject.com/useritems/RowFilterBuilder.asp ...Show All
SQL Server Restricting export of the Header
Hello Is it possible to restrict the export of the header when exporting the report from the browser or at least restrict the export of the image. Thanks Inder The answer is no. You can't have conditional rendering based on the target output format e.g. HTML or XLS or PDF etc. What's to stop someone taking a screen caprute or right clicking the image and choosing the "Save Picture As..." option in IE ...Show All
Windows Forms How to override the default HTTPHeaders in WebBrowser.Navigate(,,,) method
Hi, I am using WebBrowser.Navigate method in my project. I need to override the default HTTP headers that is used by this web browser . WebBrowser1.Navigate( urlString As String , targetFrameName As String , postData As Byte (), additionalHeaders As String ) I need to change some headers especially the "Cookie" values in my modified HTTP Request that i want to send to a web server. After assigning some cookie values to the additionalHeaders string and calling the webbrowser navigate method, it still sends the original previous cookie to the web server and not my assigned values. here is the code, additionalHeaders = "Cookie: PREFID=1323:abc"+ VBCRLF + "Content-Type: application/x-www-form-url ...Show All
Windows Forms Include the parent control when a child is cut / copied and pasted.
Hi all, This is the final step in what became a rather involved process. The big picture is that I need to present a container control at design-time which does NOT clip its children. So yeah, I want for instance a child button control to be able to draw beyond its parent's bounds. I've gotten it to work by implementing an "envelope / hub" mechanism, where the hub is the above-mentioned container, and the envelope is its parent, another container which sizes itself to envelop the hub. When the user needs to "float" (ie. un-clip) the child button, it gets re-parented to the envelope and now has free reign to paint over the hub's bounds. All that to say, I have one final problem: when the hub is cut to clipboard, ...Show All
.NET Development Site License protection schemes, defeating Reflector?
I am invovled in the development of a programmer tool written in asp.net 2.0. My company is interested in securing this tool via an encrypted license file. However, we realize that anyone using Reflector could easily crack our protection. One way around this would be to make extensive use of web services, but this is not an acceptable solution for us. Would using unmanaged code to perform some core functionality solve this problem The unmanaged could could check the encrypted license file and when decompiled, it would not be as insecure as decompiled managed code. Has anyone done this Is the theory sound Native, unmanaged code is the only way to provide equal security to Win32 binaries. Obfu ...Show All
Visual Studio Express Editions a few questions
I have a view question: how can i add rulers to my program. if i have inserted an image in a rich text box how can i save the text and the image. how can i save diffrent fonts in the rich text box how can i add a table to the rich text box and save it. how can i send the file that was typed in the rich text box as an attachment wit E-mail how can i save and not save as Please help me For faster and better responses try and keep your threads to a minimum of specific questions Rulers....You will have to create your own custom control 2. By saving the data in the richtextbox as an RTF file - Me . RichTextBox1 . SaveFile ( "TheFilePath" , RichTextBoxStreamType . RichText ) 3. Me . RichTextBox1 ...Show All
Windows Forms Using tooltips in a datagridview
I wrote a program where in a form I'm displaying a datagridview. It's configuration occurs in the following function: private void GridLoad() { // Listing competenties grdCompetenties.DataSource = m_oCompetenties.Lijst; grdCompetenties.RowHeadersVisible = false; grdCompetenties.ColumnHeadersVisible = false; grdCompetenties.AllowUserToAddRows = false; grdCompetenties.AllowUserToDeleteRows = false; grdCompetenties.AllowUserToOrderColumns = true; grdCompetenties.DefaultCellStyle.BackColor = Color.FromName("BlanchedAlmond"); grdCompetenties.AlternatingRowsDefaultCellStyle.BackColor = Color.FromName("Wheat"); // sComptentie_ID grdCompetentie ...Show All
Visual C# Interfaces oversold???
First, I must admit that I am a C# novice and so I probably don’t have as much knowledge and experience on the subject of interface as most of you guys reading this post. After reading a few books on C# and interface design, I still can’t see and understand the real power of interface unless of course, we are talking about interfaces as a powerful concept in OOP ‘only’ and not as a powerful concept in the general sense. When I was first learning OOP I was quite suspicious about the ‘excellent features’ that OOP claims to be able to deliver to the world and I was right. For example, in reality OOP offers very little if any, code reuse. I am now having the same suspicion about interfaces even though I see a lot nice words used to d ...Show All
