Mithun Dhali's Q&A profile
.NET Development IO.Stream direct to byte array
I have set up a client / server windows application in VB.NET 2005. The code uses HTTP requests and an HTTP listener to communicate over the network. I send a byte array via the request. GetRequestStream Class. When the listener tries to extract the byte stream I end up with an error because it can't seek; the size of the content varies greatly so I can't guess byte array size. I need to know some way to read the stream into a byte array. Probably a really easy answer, but I can't figure it out. Here is the gist of the code I am using now: Dim inboundBuffer As Byte () inboundBuffer = New Byte ( CInt (ReceiveStream)) {} ReceiveStream.Read(inboundBuffer, 0, [max length]) Adam ...Show All
Visual C# copy local default to "false"
Currently when I add assembly which is created by us to project through "add reference" dialog default "copy local " property for added assembly is "True". Is there any way it is possible, when I add assebly in project ,it has default "copy local " property "False" Is this information stored in a file for the solution or project so that a script could modify the file directly and change all reference copy-local properties ...Show All
Visual Studio Express Editions I just don't understand Visual Studio Express Edition 2005
I see that in the menu there is build code. There is also compile code. BUT WHY IS THERE NO RUN PROGRAM Where do I go to RUN THE PROGRAM 2. I'm getting the cannot compile with the /clr option. I don't know how I triggered it. This is the code so far: #include <stdio.h> #include <stdlib.h> int main( void ) { int num[100]; int i, j, k, q, sum; int even[j], odd[k]; for (i=0, j=0, k = 0; i < 100; i++) { num = rand() % 1000 + 1; if (num %3 ==0 || num % 7 ==0) { num = -num ; } { if (num % 2 == 0) { even[j] = num ; j++; } else odd[k] = num ; k++; } if (i%10 ==0) printf( "\n %d_" , &n ...Show All
Visual Studio Team System WSS & SSL
I am fighting with the TFS setup for the fourth day in a row. I am making progress, but now I hit a brick wall. In IIS I added a SSL binding to the Default Web Site that hosts the WSS stuff by setting SecureBindings to ":443:www.tfs.fnu.mycompany.com" That worked and I can now access the WSS stuff via the https protocoll on port 443. I then updated the TFS registration info with tfsreg, in particular for the WSS stuff I changed the ServiceInterface for BaseServerUrl and BaseSiteUrl to the new https DNS name. I can browse projects just fine, all over port 443 and SSL. But project creation doesn't work. I narrowed it down to the following problem. Team Explorer seems to call the /_vti_adm/admin.asmx on the WSS administr ...Show All
Game Technologies: DirectX, XNA, XACT, etc. How to get a lit sphere colored sphere/cube in XNA
I've been trying to do this for the past few days asking many questions to get to this seemingly simple goal, but i just run into problems at every step. In MDX I just created a mesh object, then: myMesh = mesh.Box(...) or myMesh = mesh.Sphere(...) In XNA I've had to go through making custom vertex formats, manually drawing all the sides of the box, and now even worse it seems I have to manually input the vertex normals and am STILL unsuccesful...i have no idea if i'm expected to do this for a sphere. This seems too massive a step back for something that is supposed to be superior to MDX, so I clearly have to be missing out on a key point... I realised MDX is being discontinued and i decided to move on to XNA, but I'm considering just goin ...Show All
Visual Basic Streamwriter in VB 2005
This SHOULD be easy. I must be missing something. I'm assembling a long string and trying to write it out to a file. If I display it in a message box or textbox, it looks fine. But when I write it out to a file, it gets chopped off. I thought it might be my data, because it is supposed to be HTML, but it seems to be related to the amount of data, because it chops off at about the same number of lines no matter what the data. I tried breaking it into smaller strings and doing two writelines, but it still does the same thing. lname = names(1) outFile = "D:\Class of 57\updatehtm\" & lname & ".htm" output = New FileStream(outFile, FileMode.OpenOrCreate, FileAccess.Write) fileWriter = New StreamWriter(outp ...Show All
SQL Server Error on Export to Excel with Bookmarks and Navigation Jumps
Hello All, We're running RS 2005. I have a problem in a report using two main sections. There's a top level report, made up from 4 tables within a rectangle. The second section of the report contains the detail of the calculations making the top level figures. The second section of the report contains bookmarks and jump links to drill to different levels of the reporting structure. This works fine. The top level of the report also has jump to bookmark links to drop into the relevant section of section two, and display the detail. The problem I'm having is that although the jump links work fine within report manager, the report will not export to excel from report manager. It errors with the error at the bottom o ...Show All
Visual C# Problem with loading/unloading DLL from a separate appDomain
Hi, I want to dynamically loading assembly dll to have an instance of a type in that assembly. The thing is the assembly is updated on demand frequently so I need to unload and then reload the dll. So I load it from a separate domain. First I create a new appDomain using AppDomainSetup with shadow copy enabled: AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; setup.CachePath = AppDomain.CurrentDomain.BaseDirectory+"\\Shadow"; setup.ApplicationName = "Loading"; setup.ShadowCopyFiles = "true"; setup.ShadowCopyDirectories = AppDomain.CurrentDomain.BaseDirectory; newDomain = AppDomain.CreateDomain( "loaderDomain", null, setup); Then a remoteLoader is created ...Show All
Smart Device Development Question about .NET CF Runtime
Hi there, I'm in the end stage of my first program, and I was wondering if there's a way to deploy a program with the .NET CF Runtime, so that there is no additional file(s) needed to be downloaded. Thanks, Martina all Windows Mobile 2003SE/2005 devices I believe come shipped with .NET CF 1.0 SP3 so you shold be good to go. As for .NET CF 2.0 , I am unsure. I think you would have to include those files in your deployment solution and then execute the .NET 2.0 CF installer you may want to check this out: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=390887&SiteID=1 http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=495930&SiteID=1 ...Show All
Visual Basic Login Form VB 2005
Hi , i can’t make a loging form, checking a database users, i already have the users db, but how can i made th validation, a full step explanation it'll be great, please help me i already read a lot of books about vs2005, but i still with this trouble i'm usin Microsoft SQL server, thanks a lot!!! ok, done here and before to continue thanks for the help and patience, i'm a begginer in this, so thaks again, i have a data set, called "Usersds.xsd" with User, ID and Password rows, and a single form with two text box, one called "txtusername" and "txtpasword" and two buttons one "button1" supose to be Ok and "Button2" supose to be Cancel, ok so when i click to ok the text in the Username and passwo ...Show All
Visual Basic How can i make e-mail mask
How can i make e-mail mask Please help me I need a mask or some one tell me how to make one thanks you could use a maskedtextbox: http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.aspx http://msdn2.microsoft.com/en-us/library/kkx4h3az.aspx to create your email address style/field/column data input you could also use this regex (regular expression) to validate the inputs and check to see if it is a valid email address, if not, then prompt them to enter a correct email address (there are many variations, im no regex guru but this one works reasonably well): private function ValidateEmail(byval emailAddress as String) as Boolean Dim theRegexValidator as new Regex("^([a-zA-Z0 ...Show All
Software Development for Windows Vista ICredentialProvider
Did anybody make a successful user logon using the new ICredentialProvider interface My credentials are displayed, but I can't make them to logon. And what worse - after 20 or 30 seconds, the winlogon crashes completely with no recovery possible excepting hardware reset. I thought I basically did something wrong and decided to wait for more detailed documentation or some sample code. But MS doesn't seem to put too much effort on improving their SDK documentation and I also found that at least one other programmer has the same problem: http://msdn.microsoft.com/newsgroups/default.aspx query=vista&dg=microsoft.public.platformsdk.security&cat=en-us-msdn-windev-winsdk&lang=en&cr=US&pt=&catli ...Show All
Visual Basic FormClosing Event
Hi there. I have an inherited form hierarchy where the root form captures the FormClosing event, which then invokes a overriden "FormClose" method. The overriden method correctly determines the value of the e.cancel attribute and passes it back to the root FormClosingEvent handler. However, when e.cancel = true the form closing event is not canceled and the form closes anyway. The root form, and all it's children, are children for a MDI form. Can anyone tell me why e.cancel = true in the case doesn't prevent the form from closing Thanks. Here is the declaration of the FormClosing Event handler: Private Sub StandardUIForm_FormClosing( ByVal sender As Object , ByVal e As System.Windows.Forms.FormClosingEve ...Show All
Visual C# pause an almost infinity while loop
I have a while loop need to querry data and display in one tab on the form. The thing is that is hard to change handle to another tab on moving the form around on the screen. Is there a way to pause the while loop while i want to do these actions Thank you not really. You can use Thread.Sleep( time ) however this will pause the entire thread meaning you will still be unable to click your control. Best thing to do maybe to execute this while loop in another thread but threading can be expensive so I would suggest to find another way of doing what you are doing before thinking about using threading or backgroundworker component Can I ask what this loop does and what it looks like ...Show All
SQL Server Can't execute View script using SMO
Hi ! I have another problem. Here is now what i'm doing: Dim unTransfert As New Transfer(BDConfig) unTransfert.CopyAllObjects = True unTransfert.DropDestinationObjectsFirst = True unTransfert.CopySchema = True unTransfert.CopyData = False unTransfert.Options.ContinueScriptingOnError = True unTransfert.DestinationServer = ServeurLocal.Name.ToString unTransfert.DestinationDatabase = NouvelleBD.Name.ToString unTransfert.Options.IncludeIfNotExists = True NouvelleBD.ExecuteNonQuery(unTransfert.ScriptTransfer()) This failed because of my views. If i tried to copy tables only it's working fine. I've tried to copy one by one the view and then i notice that most of then failed and i think i know the reason but i don't know what to do. I've notice ...Show All
