|
Yes.. But I guess giving proper rights to the user (or impersonating) to run the aspnet worker process as an administrator will surely solves the issue ..
But seriously... this is not generally what we do often... but it is possible I guess.
Cheers..
|
|
|
|
|
srikantha_nagaraj wrote: When internet explorer opens my dotnet code should identify that.
Why do you need that ? Do you need it for an ASP.NET Application or any win Application ?
srikantha_nagaraj wrote: Please help me with this.
Please be specific while asking any question so that we can help you at best !!
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi all,
i know this is not a windows app forum but i want to pass querystring from my web page and fetch it into my windows application.
I am using some 3rd party tool web GUI for my windows app to run it as web application.
Plz help.....
|
|
|
|
|
bhavnvyas wrote: I am using some 3rd party tool web GUI for my windows app to run it as web application.
Then You better ask third pary tool developing team..!
As you are using the 3rd party tool first check tht it is supported for such type..!
BTW You didnt mention the 3 rd party vendor name so tht if any one uses the 3rd party tool before they can help You..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
thnx for reply
but WebGUI itself is a my tool.
leave it neways but wat if i am developing somt web gui application in windows app thn how to fetch querystring data...plz help....
|
|
|
|
|
bhavnvyas wrote: web gui application in windows app
What do you mean by tht..!
Can You Explain it More briefly..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
thnx again
in my web site i want to use some windows form features so for tht i am inclunding one page which is basically windows form for tht i am using webgui visual studio express which run my application in web.
so i want to pass querystring from my web application page to this windows app page which is basically .wgx page
|
|
|
|
|
What is the problem.... load the page using Webbrowser control of your windows application and invoke the items which you need to get the querystring...
For example :
Say I add a Webbrowser control on my form,
now during form load I pass
wbrowser.Navigate(new Uri("http://codeproject.com"));
Next I navigate to an article. You might invoke browser buttons to navigate. Finally to get the querystring you use :
wbrowser.Url.Query
I hope this is what you needed.
Next time post in right section.
|
|
|
|
|
Is there any simple code to resize the image in image upload and at the time of showing the image in asp.net.
plz urgent
thanks
|
|
|
|
|
public static string Resize(string InputFilePath, string Name, int TargetWidth, int TargetHeight, string Extension, string TargetFolder)
{
string thumbnailFilePath = string.Empty;
string FileName = string.Empty;
Size newSize;
try
{
using (Bitmap bmp = new Bitmap(InputFilePath))
{
newSize = GetRelativeImageSize(bmp.Width, bmp.Height, TargetWidth, TargetHeight);
FileName = Name + Extension;
thumbnailFilePath = TargetFolder + FileName;
using (Bitmap thumb = new Bitmap((System.Drawing.Image)bmp, newSize))
{
using (Graphics g = Graphics.FromImage(thumb)) // Create Graphics object from original Image
{
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
//Set Image codec of JPEG type, the index of JPEG codec is "1"
System.Drawing.Imaging.ImageCodecInfo codec = GetImageCodec(Extension);
//Set the parameters for defining the quality of the thumbnail... here it is set to 100%
System.Drawing.Imaging.EncoderParameters eParams = new System.Drawing.Imaging.EncoderParameters(1);
eParams.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L);
//Now draw the image on the instance of thumbnail Bitmap object
g.DrawImage(bmp, new Rectangle(0, 0, thumb.Width, thumb.Height));
thumb.Save(thumbnailFilePath, codec, eParams);
}
}
}
}
catch (Exception ex)
{
throw ex;
}
return FileName;
}
//it will return the file name with resize.
private static Size GetRelativeImageSize(int SourceWidth, int SourceHeight, int TargetWidth, int TargetHeight)
{
float nPercent = 0;
float nPercentW = 0;
float nPercentH = 0;
if (SourceWidth <= TargetWidth && SourceHeight <= TargetHeight)
{
return new Size(SourceWidth, SourceHeight);
}
else if (TargetWidth == 0)
{
if (SourceHeight > TargetHeight)
{
nPercentH = ((float)TargetHeight / (float)SourceHeight);
nPercent = nPercentH;
}
else
return new Size(SourceWidth, SourceHeight);
}
else if (TargetHeight == 0)
{
if (SourceWidth > TargetWidth)
{
nPercentW = ((float)TargetWidth / (float)SourceWidth);
nPercent = nPercentW;
}
else
return new Size(SourceWidth, SourceHeight);
}
else
{
nPercentW = ((float)TargetWidth / (float)SourceWidth);
nPercentH = ((float)TargetHeight / (float)SourceHeight);
if (nPercentH < nPercentW)
{
nPercent = nPercentH;
}
else
{
nPercent = nPercentW;
}
}
return new Size(Convert.ToInt32(SourceWidth * nPercent), Convert.ToInt32(SourceHeight * nPercent));
}
Regards
Keyur Satyadev
|
|
|
|
|
thanks for the code
what about the functon of
GetImageCodec(Extension)
you dont declare this function.
|
|
|
|
|
private static ImageCodecInfo GetImageCodec(string Ext)
{
switch (Ext)
{
case ".jpg":
return ImageCodecInfo.GetImageEncoders()[1];
case ".gif":
return ImageCodecInfo.GetImageEncoders()[2];
case ".bmp":
return ImageCodecInfo.GetImageEncoders()[0];
case ".png":
return ImageCodecInfo.GetImageEncoders()[4];
case ".jpeg":
return ImageCodecInfo.GetImageEncoders()[1];
case ".tif":
return ImageCodecInfo.GetImageEncoders()[3];
case ".jpe":
return ImageCodecInfo.GetImageEncoders()[1];
case ".jfif":
return ImageCodecInfo.GetImageEncoders()[1];
case ".tiff":
return ImageCodecInfo.GetImageEncoders()[3];
default:
return ImageCodecInfo.GetImageEncoders()[1];
}
}
Regards
Keyur Satyadev
|
|
|
|
|
Hi!!
I'm trying use this code but does not working.
Please help me.
Simply does not work, not of error but also does not work.
public void carregarImagem()
{
string path = "~/imagens/" + FileUpload1.FileName;
string folder = "~/imagens/";
string nome = FileUpload1.FileName;
int largura = Convert.ToInt32(w.Text);
int altura = Convert.ToInt32(h.Text);
string ext = System.IO.Path.GetExtension(FileUpload1.FileName);
string name = "~/imagens/" + FileUpload1.FileName;
Resize(picImage.ImageUrl, nome, largura, altura, ext, folder);
//used to show image
picImage.ImageUrl = name;
}
|
|
|
|
|
|
I'm tring to use this function "CreateThumbnail", but dosen't work.
Just dont show me nothing.
Please.
|
|
|
|
|
i want to save items in listbox without using data base.how it is possible
|
|
|
|
|
Use "Session" if you want it on multiple page or through out the site.
Regards
Keyur Satyadev
|
|
|
|
|
|
Thats really Basic stuff.. Hope u must start reading a good book....
|
|
|
|
|
Hi,
I am developing a solution using MVC frame work and now I see that I have top heavily depend on the HTML Helper class and I am not using any of the server objects. It takes lot more time to do any thing now wrt server controls.
How can I introduce/use server controls with out breaking the MVC gudelines.
Regards,
Pavas
|
|
|
|
|
i am very new in aspdotnetstorefront and want to change skin of storfront
from manual of aspdotnetstorefront i try to follow steps to change skin but i have to face many problems and still unable to change skin
please guide me how i can change skin
i have html and css pages
Regards
|
|
|
|
|
You have to be familiar with XSLT before you can effectively skin ASPDNSF. Trust me, I've been down that road of hell before.
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
i have read XSLT but still unable to decide how i should start and how should take first step to change skin.
i am trying to change skin of home page and i am working with template.aspx and style.css which are in skin folder
please can you tell me few tips or steps
Thanks
Best Regards
|
|
|
|
|
Ok, here's my problem. I have two pages: one called FirstPage.aspx and the other one called SecondPage.aspx. Here's what I want to do... I start with FirstPage.aspx and here I have a button and when I click it SecondPage.aspx appears. I do that using Response.Redirect("SecondPage.aspx", false). Ok, now when it loads the second page I want to show in a label the name of the first page. How can I do that? If I have used the PostBackUrl property of the button from the first page, this would have been easy. I would have written in the SecondPage:
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (PreviousPage != null)<br />
{<br />
Label1.Text = PreviousPage.Title;<br />
}<br />
<br />
}<br />
But, I need to show the second page using Response.Redirect("SecondPage.aspx", false). So any help?
|
|
|
|
|
Just pass the value using Querystring...
Do like this when you navigate to the second page:
Response.Redirect("secondpage.aspx?name=" + pagename);
After you redirect, you will find the value of name easily.
In Page_load :
protected void Page_Load(object sender, EventArgs e)
{
string firstpagename = Request.QueryString["name"];
Label1.Text = firstpagename;
}
I think this is what you needed.
Cheers.
|
|
|
|