|
Hi,
Thanks for the idea but I'd like to do this will any registered file format! Not just images (I used that as an example).
I have a program that's associated with a file format. When you double click the file from Windows explorer it loads the file from a database using the associated program (eg word for .doc, excel for .xls etc etc)
I'm using C#
Thanks
|
|
|
|
|
Hello everyone, my name is kenny, Im kinda new to the codeproject.com scene and somewhat to the .NET framework scene. Anyways, Im going to start making video tutorials, and i wanted some feedback on where i should start, (basics -> advanced), requests only, etc...
|
|
|
|
|
Dear member,
you can visit www.learnvisualstudio.net for informative video tutorials on visual studio 2005
It is a very helpful site for learning c#. You may also download the following for microsoft.com
visual C# 2005 ExpressEdition with MSDN and SQL Server 2005 Express Edition
Wish you all the best
Renjith
|
|
|
|
|
if i program an use variable in java script, how can i "work" with it in the C# source?
is it with Document?
HHHHHHHHHEEEEEEELLLLLLLLLPPPPPPPPP.
Thanks
e.g.: i want to work with the xmlhttp.responsetext???
function MyFunc()
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("GET","http://www.msn.com",false);
xmlhttp.Send();
alert(xmlhttp.responsetext);
}
|
|
|
|
|
The JavaScript code to which you refer runs in a client's browser. The C# code to which you refer runs on a Web or application server. In this scenario, the two don't exist together in the same process space and can, therefore, not "share" variables.
You can only "share" values through serializing between the two processes, usually through HTTP requests.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
So you mean that i can not use the text that i got from the activeXobject, so how can i get the source code of a site, i mean the html source and work with it in the server side?
Thanks
|
|
|
|
|
I don't mean to appear obtuse, but I'm a tad confused about your goal. Could you give me another example of what you'd like to do?
If you're just trying to use the XMLHTTP object in IE, then you can read Using Microsoft's XMLHTTP Object to Get Data From Other Web Pages[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I'm having an issue in an Excel project I'm doing with VSTO.
Buttons that are not initially displayed when the page is loaded, do not become "active" when they are scrolled to. They look slightly fuzzy and bolded, but do not "click," they just sit there. There is a lot of stuff going on in the VSTO document(calls to a db to save/fill data, dynamic calculation, etc), and I think this might be causing my issue
To see what I'm talking about(slightly), create a new vsto project and paste this into sheet1
<br />
private void Sheet1_Startup(object sender, System.EventArgs e)<br />
{<br />
Globals.ThisWorkbook.Application.DisplayAlerts = false;<br />
string name;<br />
for (Char x = 'A'; x <= 'Z'; x++)<br />
{<br />
name = "Button" + x.ToString();<br />
Controls.AddButton(this.Range[String.Format("{0}1", x), missing], name);<br />
Button b = (Button)this.Controls[name];<br />
b.Click += new EventHandler(b_Click);<br />
b.Text = name;<br />
}<br />
<br />
}<br />
<br />
void b_Click(object sender, EventArgs e)<br />
{<br />
Button B = sender as Button;<br />
Random r = new Random();<br />
String bStr = B.Text.Substring(6);<br />
for (int iii = 2; iii < 200; iii++)<br />
{<br />
this.Range[String.Format("{0}{1}", bStr, iii.ToString()), missing].Value2 = r.Next(100);<br />
}<br />
}<br />
Anywho, what this does is put a large row of buttons across the top of a screen, and when pressed, populates a lot of data below it(random numbers, hopefully to simulate(in a way) the load my program creates). once there is a lot of data, try scrolling down and up and notice that as the buttons come on screen, they are briefly "fuzzy" before they turn normal.
Has anyone encountered this before and know why this "refresh" might be suppressed?
|
|
|
|
|
hi all,i'm creating a mobile appliction with ms vs2005 release edition, im using a webservice from www.webservicex.com and i get the exception with the details :
Status :System.Net.WebExceptionStatus.ConnectFailure
System.Net.WebException was unhandled
Message="Could not establish connection to network."
StackTrace:
at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at DeviceApplication2.net.webservicex.www.lengthUnit.ChangeLengthUnit()
at DeviceApplication2.Form1.button1_Click()
at System.Windows.Forms.Control.onclick()
at System.Windows.Forms.Button.onclick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at DeviceApplication2.Program.Main()
&here's my code:
private void button1_Click(object sender, EventArgs e)
{
net.webservicex.www.lengthUnit l = new
DeviceApplication2.net.webservicex.www.lengthUnit();
double x = l.ChangeLengthUnit(120, DeviceApplication2.net.webservicex.www.Lengths.Feet, DeviceApplication2.net.webservicex.www.Lengths.Meters);
MessageBox.Show(x.ToString());
}
please tell me where is the error (i'm deploying it using the device emulator and the active sync program)
|
|
|
|
|
|
I have written a C# DLL that I intend to call from an unmanaged C++ app. I have so far followed all the rules that Microsoft explains in this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkcominteroppart2cservertutorial.asp[^]. My ultimate goal is to have a method in the C# DLL which will populate a string OUT parameter, and call it from C++. Something like void GetErrorString( int iErrorCode, ref string szErrorString ) . Now do not take that signature seriously - because that is what the question is! What should be the signature???? And how exactly do I call it from C++?
So far I have tried:
Attempt 1.
C# signature:
void Func2( int iCode, ref char [] szOut );
C++ call:
char szRetString[ 128 ];<br />
cpi->Func2( 10, &szRetString );
Result: Runtime error
Variation: Instead of "&szRetString" in C++, tried "szRetString". Same result.
Variation: Instead of "ref" in C#, tried without ref. Same result.
Attempt 2.
C# signature:
void Func2( int iCode, ref string szOut );
C++ call:
char szRetString[ 128 ];<br />
cpi->Func2( 10, &szRetString );
Result: Runtime error
Variation: Instead of "&szRetString" in C++, tried "szRetString". Same result.
Variation: Instead of "ref" in C#, tried without ref. Same result.
Attempt 3.
C# signature:
void Func2( int iCode, ref StringBuilder szOut );
C++ call:
char szRetString[ 128 ];<br />
cpi->Func2( 10, &szRetString );
Result: Runtime error
Variation: Instead of "&szRetString" in C++, tried "szRetString". Same result.
Variation: Instead of "ref" in C#, tried without ref. Same result.
And all the cross-variations of the above combinations as well!!!!
Can somebody please tell me where am I going wrong? My C++ project does not have UNICODE defined. But please note that I have succeeded in calling the example provided by the MSDN article (link above) - which means I am successful in sending a read - only copy of string as IN parameter into C#.
Ever wondered that microsoft examples avoid the harder part?;)
Koushik Biswas
-- modified at 16:06 Thursday 2nd March, 2006
|
|
|
|
|
Ok so I have this method:
<br />
public static string ConvertFileName(string fn)<br />
{<br />
Regex.Replace(fn, "[^\\w\\s\\.\\{}_\\-\\$&\\^!;#\\+=%]", "_");<br />
<br />
if (fn.Length > 31)<br />
fn = fn.Substring(0, 28) + ".doc";<br />
<br />
return fn;<br />
}<br />
It is supposed to take the string fn and replace any characters that do not match the regex given with underscores. For example the file name: "Horses (Big Ones).doc" should be made into "Horses _Big Ones_.doc". However, it changes nothing right now. Any suggestions what the issue is here. Ran it through a regex tester at http://www.fileformat.info/tool/regex.htm it ran fine there.
Thanks
-- modified at 15:40 Thursday 2nd March, 2006
|
|
|
|
|
That is because you do the replacement and throw away the result. The Replace method returns a string, you have to take care of the return value.
---
b { font-weight: normal; }
|
|
|
|
|
Wow... I'm going to uninstall VS, give my computer to charity, and become a monk now. I feel like an idiot. Thank you for the quick and correct response
|
|
|
|
|
I could not help stopping expressing my satisfaction on the software "RegexBuddy" for Generating Regex Snippets. This software will take description from you and generate Right Regex Snippet for you.
http://www.regexbuddy.com/
|
|
|
|
|
|
anyone know about how to extract attribute's values from meta tags in html using regular expression or dom??
|
|
|
|
|
Hi,
I have written code to dispay an xml file on the command prompt, but wierdly, I am getting system.setting[] as the output instead of the xml file..I have entered in parameters such as /xml and a path.
Here is my code..
Can anyone tell me what wrong and why I am getting a difference output ?
using System;
using System.Xml;
namespace EliteDMSUtilities
{
///
/// Summary description for Class1.
///
class EntryPoint
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
//string[] args = new string[10];
//args[0] = "/xml";
//args[1] ="C:\Test\Elite_Dms_SystemSetting.xml";
if( args.Length >0)
{
if(args.GetValue(0).ToString()== "/xml")
{
Execute_Cmd_xml(args);
}
else
{
Console.WriteLine("Unrecognized command");
Console.ReadLine();
}
}
}// end of main
static void Execute_Cmd_xml(string[] args)
{
Console.WriteLine(args.ToString());
string sIFolderName ="";
try
{
XmlDocument doc = new XmlDocument();
if (args.Length > 1)
{
for(int i=1; i < args.Length; i++)
sIFolderName = sIFolderName + " " + args.GetValue(i).ToString().ToLower();
sIFolderName = sIFolderName.TrimStart();
Console.WriteLine(sIFolderName);
doc.Load(sIFolderName);
Console.Write(doc.OuterXml);
Console.ReadLine();
}// end if
}
catch(XmlException xmlEx)
{
Console.WriteLine("Failed to load " + sIFolderName, xmlEx.Message);
}
}
}
}
Thanks
|
|
|
|
|
Hello,
I just had a general question about MSComm32 or Serial Communications in .NET. When using binary transmission and receive with RThreshold = 1 (OnComm fired after every byte), does the transmission of binary data act the same as the receive data? Meaning, do I have to place one byte at a time in the MSComm.output field or can I place a whole byte array into MSComm.output?
I tried looking for examples, but every sample I found uses text transmission or is in Win32 Native.
Any help is much appreciated. Thanks in advance.
Mike
|
|
|
|
|
hi all, im creating a pocket pc application that uses some web services,
using ms visual studio 2005 release edition(not the beta version). i have downloade active sync and i'm using the device emulator (pocket pc 2003 se) to deploy the application but i get the error "unable to connect to remote server" ,any help?
|
|
|
|
|
|
Because you posted it on at least 3 different forums on this site within minutes of each other.
Doing something like that will not get you an answer any faster, and may annoy someone who does know it enough that they won't bother to reply.
-- modified at 13:44 Thursday 2nd March, 2006
|
|
|
|
|
Unable to solve ... please help
CODE:
-----
public ProductObject[] OProduct;
ArrayList myProduct;
public void MyProduct()
{
ProductObject OProduct = new ProductObject();
myProduct = new ArrayList();
for (int i=1; i<=10; i++)
{
OProduct.Loader(i);
myProduct.Add(OProduct);
}
OProduct = (ProductObject[])myProduct.ToArray(typeof(OProduct));
}
ERROR:
------
Cannot implicitly convert type OProduct[] to OProduct
|
|
|
|
|
Pete Madden wrote: typeof(OProduct)
typeof(ProductObject)
|
|
|
|
|