|
First remove the references from the VS.NET project. Save. You can make sure the references are actually removed by opening the .csproj file in a text editor.
Remove the interop libraries in both the Debug\ dir, and Obj\ dir.
Then open a command line, and type tlbimp <path>\msword.olb (isn't it msword9.olb by the way? I am not sure). This will produces several interop libraries.
Just add any of them to your project with the AddReference project menu option.
Back to real work : D-24.
|
|
|
|
|
Many thanks!!!
Noam Ben Haim
Web Developer
Intel
noam.ben.chaim@intel.com
|
|
|
|
|
Hi!
So I'm running my first web service on my winXP PRO
with Visual Studio .NET Architect and as I try to add
a web reference to my little WebFileUtil program,
the wizard tells me to establish some proxy server stting
from Internet Explorer.
I do that, and in the LAN settings I: give it the 1.1.1.1 adress
with the port 8080.
Now, it tells me that
it is not a common known web document and that the content type
application octet stream is not fine with them thank you very much.
The web service that i'm trying to plugged is written and into my system.
It uses a struct that contains the data in a byte array.
Help me! How can I get the web reference wizard to kindly plug the web service into my WebFileUtil ????
THanks!
Orlanda
Coding is a family business
|
|
|
|
|
a system is in logoff state and i am running my service on it and i want to login through my service how to do that ?
when i send some message the the service has to parse it and login the system?
is there any api available for login?
i have a network of simple two pc and i just need username and password and no domain.
plz tell api for login and its correct parameters ?
r00d0034@yahoo.com
|
|
|
|
|
Search MSDN for "LogonUser"
(this remains low-level, as far as I know there is no such thing provided by the .NET security namespace).
Back to real work : D-24.
|
|
|
|
|
i am running my service on a computer and i want to know wheather a system is in logoff or login state?
r00d0034@yahoo.com
|
|
|
|
|
I'm trying to get a synchronous connection to a server using the various .NET stream classes. It seems that I can send a command to the server successfully, but nothing is returned (or the StreamReader returns before the data can be read off of the socket). Here's the psuedocode/real code :
static void Main(string[] args)
{
string newsServerName = "msnews.microsoft.com";
int newsServerPort = 119;
TcpClient newsServer;
try {
newsServer = new TcpClient();
newsServer.Connect( newsServerName, newsServerPort );
}
catch( SocketException e )
{
string error = "Failed to connect to " + newsServerName + " on port " + newsServerPort;
Console.WriteLine( error );
Console.WriteLine( e.Message );
return;
}
NetworkStream netStream;
StreamReader reader;
StreamWriter writer;
try {
netStream = newsServer.GetStream();
reader = new StreamReader( netStream );
writer = new StreamWriter( netStream );
if ( reader.Peek() > -1 ) {
while ( reader.Peek() > -1 ) {
Console.WriteLine( reader.ReadLine() );
}
}
string sendMessage = "LIST" + "\r\n";
Console.WriteLine( "Sending message." );
writer.WriteLine( sendMessage );
writer.Flush();
Console.WriteLine( "Waiting for response." );
while ( reader.Peek() > -1 ){
Console.WriteLine( reader.ReadLine() );
}
}
catch( Exception e ) {
Console.WriteLine( "Error talking with server." );
Console.WriteLine( e.Message );
}
}
The last while loop never writes anything out. At the very least I should get the response from the server. How can I make the StreamReader wait until there is data before trying to dump out? I know this can be done with plain Send and Recv on a Socket, but I would like to use the Stream* classes if possible.
greg
|
|
|
|
|
Try this:
string line;
while ( (line = reader.ReadLine()) != null && line != "." )
{
Console.WriteLine( line );
}
NB: .\r\n is the signal for the end of the data.
|
|
|
|
|
i am using process class for my work?
is there any why to get current running thread and its id ?and its associated hwnd?
what are standaredinput and standaredoutput properties?
is there any online example where these properties are used if yes plz provide link?
may i get currently active window hwnd of type HWND using HWNDLE property of Process?
r00d0034@yahoo.com
|
|
|
|
|
Hi Imran,
The code for
http://www.codeproject.com/useritems/popupkiller.asp
has some hints towards this.
deepak
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
This is a general windows dev question, I couldn't find it in the docs or google. How in C# do I get ahold of the windows temp directory location? You know, c:\winnt\temp, or if someone's logged in it's Documents and Settings\<username>\temp... etc etc.. Is this a good place to store temp. files, or should I use my application's install directory?
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
In WIN32, it is :
DWORD GetTempPath(
DWORD nBufferLength,
LPTSTR lpBuffer
);
Easy to interop.
You could as well use WIN32 ExpandEnvironmentStrings , passing %TMP% as parameter.
Or read the registry, etc.
Back to real work : D-25.
|
|
|
|
|
System.IO.Path.GetTempPath() will return the current temp directory.
You may want to look at isolated storage[^] instead, especially if your app will be running in a locked-down environment.
|
|
|
|
|
Well said!
public static string System.IO.Path.GetTempPath() {
StringBuilder local0;
uint local1;
string local2;
new EnvironmentPermission(1).Demand();
local0 = new StringBuilder(260);
local1 = Win32Native.GetTempPath(260, local0);
local2 = local0.ToString();
if (!(local1))
__Error.WinIOError();
return local2;
}
Back to real work : D-25.
|
|
|
|
|
Bah! You need Anakrino to tell you that? I can read it in IL!
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
David Stone wrote:
Bah! You need Anakrino to tell you that? I can read it in IL!
You asking for a slap.
you think ur soo cool wiv ur li'l IL book
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
Nnamdi Onyeyiri wrote:
You asking for a slap.
Ah. You don't understand...it's an inside joke.
Nnamdi Onyeyiri wrote:
you think ur soo cool wiv ur li'l IL book
Yeah...that's me...I'm cool...I'm bad...uh-huh oh yeah!
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
David Stone wrote:
Ah. You don't understand...it's an inside joke.
Oh, maybe its that you dont understand how lightly that phrase is used here.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
|
I'm going to use System.IO.Path.GetTempPath() as richard_d suggested. My app is a desktop windows app so I dont think I'll need special storage.
thanks
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
I want to be able to create a program that will parse a flat file into an xml file that a typed dataset can read or parse the flat file into a custom generated typed dataset. Is this possbile and if so how would I use codedom, etc to get this result?
|
|
|
|
|
|
Search MSDN for Interop and API
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
I am writing a code generator that reads in a text file containing source code. The file is my template and it contains {1}, {2}... {n} items in it. I read the file into a string and then I interpolate those values using String.Format(string format, params object[] args). It seems to work fine as long as I don't have any squiggly braces in it ({}) other than the ones that I want to use for formatting (e.g. the {1}, {2}, etc values). It appears that String.Format is choking on the other braces in the code template. I get the exception 'System.FormatException - Input string was not in the correct format'. Does anyone know why this is and how to fix it? Does this makes sense?
Thanks in advance.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Escaping braces is achieved by doubling them. Example : string s = Stirng.Format("my number {{is}} {0}",45);
Back to real work : D-26.
|
|
|
|